Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 79f59b0d authored by Anastasia Belova's avatar Anastasia Belova Committed by Lee Jones
Browse files

UPSTREAM: xfrm: compat: change expression for switch in xfrm_xlate64



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.

Bug: 254441685
Fixes: 4e9505064f58 ("net/xfrm/compat: Copy xfrm_spdattr_type_t atributes")
Signed-off-by: default avatarAnastasia Belova <abelova@astralinux.ru>
Acked-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Tested-by: default avatarDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
(cherry picked from commit eb6c59b735aa6cca77cdbb59cc69d69a0d63d986)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I3f765d0dea1fd3fc431c09f4e6e3f2f98a8f8158
parent 35093f38
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;