]> asedeno.scripts.mit.edu Git - linux.git/commit
netfilter: ipset: fix suspicious RCU usage in find_set_and_id
authorKadlecsik József <kadlec@blackhole.kfki.hu>
Sat, 25 Jan 2020 19:39:25 +0000 (20:39 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 29 Jan 2020 17:34:46 +0000 (18:34 +0100)
commit5038517119d50ed0240059b1d7fc2faa92371c08
tree734a5ef3cf9088a851c29056ad9c65ef98eb3cbd
parent44efc78d0e464ce70b45b165c005f8bedc17952e
netfilter: ipset: fix suspicious RCU usage in find_set_and_id

find_set_and_id() is called when the NFNL_SUBSYS_IPSET mutex is held.
However, in the error path there can be a follow-up recvmsg() without
the mutex held. Use the start() function of struct netlink_dump_control
instead of dump() to verify and report if the specified set does not
exist.

Thanks to Pablo Neira Ayuso for helping me to understand the subleties
of the netlink protocol.

Reported-by: syzbot+fc69d7cb21258ab4ae4d@syzkaller.appspotmail.com
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_core.c