Skip to content

Commit 914073a

Browse files
author
CIQ Kernel Automation
committed
net: openvswitch: fix nested key length validation in the set() action
jira VULN-162463 cve CVE-2025-37789 commit-author Ilya Maximets <i.maximets@ovn.org> commit 65d9119 It's not safe to access nla_len(ovs_key) if the data is smaller than the netlink header. Check that the attribute is OK first. Fixes: ccb1352 ("net: Add Open vSwitch kernel components.") Reported-by: syzbot+b07a9da40df1576b8048@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b07a9da40df1576b8048 Tested-by: syzbot+b07a9da40df1576b8048@syzkaller.appspotmail.com Signed-off-by: Ilya Maximets <i.maximets@ovn.org> Reviewed-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Aaron Conole <aconole@redhat.com> Link: https://patch.msgid.link/20250412104052.2073688-1-i.maximets@ovn.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 65d9119) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent 1d134a4 commit 914073a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

net/openvswitch/flow_netlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2860,7 +2860,8 @@ static int validate_set(const struct nlattr *a,
28602860
size_t key_len;
28612861

28622862
/* There can be only one key in a action */
2863-
if (nla_total_size(nla_len(ovs_key)) != nla_len(a))
2863+
if (!nla_ok(ovs_key, nla_len(a)) ||
2864+
nla_total_size(nla_len(ovs_key)) != nla_len(a))
28642865
return -EINVAL;
28652866

28662867
key_len = nla_len(ovs_key);

0 commit comments

Comments
 (0)