summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnastasia Belova <abelova@astralinux.ru>2023-01-10 12:14:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-14 21:11:42 +0300
commitcf118814ae89f4ae702fd376089cdac296915877 (patch)
tree8cf9cff50a746c8b8bd889bc8ab947432f3e649e
parent3fc0b7b7e9a571426613ea678b5a8c5efe8c8f52 (diff)
downloadlinux-cf118814ae89f4ae702fd376089cdac296915877.tar.xz
xfrm: compat: change expression for switch in xfrm_xlate64
[ Upstream commit eb6c59b735aa6cca77cdbb59cc69d69a0d63d986 ] 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: 4e9505064f58 ("net/xfrm/compat: Copy xfrm_spdattr_type_t atributes") Signed-off-by: Anastasia Belova <abelova@astralinux.ru> Acked-by: Dmitry Safonov <0x7f454c46@gmail.com> Tested-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--net/xfrm/xfrm_compat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c
index a0f62fa02e06..12405aa5bce8 100644
--- a/net/xfrm/xfrm_compat.c
+++ b/net/xfrm/xfrm_compat.c
@@ -302,7 +302,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;