提交 cdd2af7c 编写于 作者: A Anastasia Belova 提交者: zhaoxiaoqiang11

xfrm: compat: change expression for switch in xfrm_xlate64

stable inclusion
from stable-v5.10.168
commit 3797e94c1992c92038911df5efdab2b4496bb1e9
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7URR4

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

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

[ Upstream commit eb6c59b7 ]

Compare XFRM_MSG_NEWSPDINFO (value from netlink
configuration messages enum) with nlh_src->nlmsg_type
instead of nlh_src->nlmsg_type - XFRM_MSG_BASE.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 4e950506 ("net/xfrm/compat: Copy xfrm_spdattr_type_t atributes")
Signed-off-by: NAnastasia Belova <abelova@astralinux.ru>
Acked-by: NDmitry Safonov <0x7f454c46@gmail.com>
Tested-by: NDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: Nzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
上级 14c60528
......@@ -300,7 +300,7 @@ static int xfrm_xlate64(struct sk_buff *dst, const struct nlmsghdr *nlh_src)
nla_for_each_attr(nla, attrs, len, remaining) {
int err;
switch (type) {
switch (nlh_src->nlmsg_type) {
case XFRM_MSG_NEWSPDINFO:
err = xfrm_nla_cpy(dst, nla, nla_len(nla));
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册