Skip to content

Commit 4f77f01

Browse files
author
CIQ Kernel Automation
committed
rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation
jira VULN-5271 cve CVE-2024-36017 commit-author Roded Zats <rzats@paloaltonetworks.com> commit 1aec77b 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: 79aab09 ("net: Update API for VF vlan protocol 802.1ad support") Signed-off-by: Roded Zats <rzats@paloaltonetworks.com> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://lore.kernel.org/r/20240502155751.75705-1-rzats@paloaltonetworks.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 1aec77b) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent 523dd25 commit 4f77f01

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/core/rtnetlink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
23782378

23792379
nla_for_each_nested(attr, tb[IFLA_VF_VLAN_LIST], rem) {
23802380
if (nla_type(attr) != IFLA_VF_VLAN_INFO ||
2381-
nla_len(attr) < NLA_HDRLEN) {
2381+
nla_len(attr) < sizeof(struct ifla_vf_vlan_info)) {
23822382
return -EINVAL;
23832383
}
23842384
if (len >= MAX_VLAN_LIST_LEN)

0 commit comments

Comments
 (0)