]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
Fix incorrect type in assignment of ipv6 port for audit
authorCasey Schaufler <casey@schaufler-ca.com>
Mon, 28 Feb 2022 23:45:32 +0000 (15:45 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:58:22 +0000 (11:58 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit a5cd1ab7ab679d252a6d2f483eee7d45ebf2040c ]

Remove inappropriate use of ntohs() and assign the
port value directly.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 05ba7d0c639fccbd9948d6ced168c5532379852b)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
security/smack/smack_lsm.c

index f08336bd8022d42960e2e33d525cae8b5de40fe0..0d238fe99c172c9bbdb52b5f804d0e6a0632e195 100644 (file)
@@ -2498,7 +2498,7 @@ static int smk_ipv6_check(struct smack_known *subject,
 #ifdef CONFIG_AUDIT
        smk_ad_init_net(&ad, __func__, LSM_AUDIT_DATA_NET, &net);
        ad.a.u.net->family = PF_INET6;
-       ad.a.u.net->dport = ntohs(address->sin6_port);
+       ad.a.u.net->dport = address->sin6_port;
        if (act == SMK_RECEIVING)
                ad.a.u.net->v6info.saddr = address->sin6_addr;
        else