提交 79b40f91 编写于 作者: C Casey Schaufler 提交者: Zheng Zengkai

Fix incorrect type in assignment of ipv6 port for audit

stable inclusion
from stable-v5.10.110
commit f038185b6a62e05c3258a4353c7183f8d1b24b1e
bugzilla: https://gitee.com/openeuler/kernel/issues/I574AL

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f038185b6a62e05c3258a4353c7183f8d1b24b1e

--------------------------------

[ Upstream commit a5cd1ab7 ]

Remove inappropriate use of ntohs() and assign the
port value directly.
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NCasey Schaufler <casey@schaufler-ca.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 7579201f
......@@ -2506,7 +2506,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册