]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: openvswitch: fix nested key length validation in the set() action
authorIlya Maximets <i.maximets@ovn.org>
Sat, 12 Apr 2025 10:40:18 +0000 (12:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:42 +0000 (10:45 +0200)
commit824a7c2df5127b2402b68a21a265d413e78dcad7
tree65f37f095c55aa9c2f0cc447a52b754a66664f3e
parent549cbbd14bbec12469ceb279b79c763c8a24224e
net: openvswitch: fix nested key length validation in the set() action

[ Upstream commit 65d91192aa66f05710cfddf6a14b5a25ee554dba ]

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: ccb1352e76cf ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/openvswitch/flow_netlink.c