Skip to content
Commit 2c0cb806 authored by Roded Zats's avatar Roded Zats Committed by Ziyang Xuan
Browse files

rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation

stable inclusion
from stable-v4.19.314
commit 8ac69ff2d0d5be9734c4402de932aa3dc8549c1a
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9TLS8
CVE: CVE-2024-36017

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



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

[ Upstream commit 1aec77b2bb2ed1db0f5efc61c4c1ca3813307489 ]

Each attribute inside a nested IFLA_VF_VLAN_LIST is assumed to be a
struct ifla_vf_vlan_info so the size of such attribute needs to be at least
of sizeof(struct ifla_vf_vlan_info) which is 14 bytes.
The current size validation in do_setvfinfo is against NLA_HDRLEN (4 bytes)
which is less than sizeof(struct ifla_vf_vlan_info) so this validation
is not enough and a too small attribute might be cast to a
struct ifla_vf_vlan_info, this might result in an out of bands
read access when accessing the saved (casted) entry in ivvl.

Fixes: 79aab093 ("net: Update API for VF vlan protocol 802.1ad support")
Signed-off-by: default avatarRoded Zats <rzats@paloaltonetworks.com>
Reviewed-by: default avatarDonald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20240502155751.75705-1-rzats@paloaltonetworks.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZiyang Xuan <william.xuanziyang@huawei.com>
parent 0a378cfa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment