diff options
author | Florian Westphal <[email protected]> | 2022-05-20 00:02:03 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <[email protected]> | 2022-05-27 11:16:33 +0200 |
commit | ffd219efd9ee1ceccc7ccfa9361fd40705680fc3 (patch) | |
tree | 24deb559efab08e0288c735ac82d50435b6e69ca /tools/perf/scripts/python | |
parent | 02ded5a173619b11728b8bf75a3fd995a2c1ff28 (diff) |
netfilter: nfnetlink: fix warn in nfnetlink_unbind
syzbot reports following warn:
WARNING: CPU: 0 PID: 3600 at net/netfilter/nfnetlink.c:703 nfnetlink_unbind+0x357/0x3b0 net/netfilter/nfnetlink.c:694
The syzbot generated program does this:
socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER) = 3
setsockopt(3, SOL_NETLINK, NETLINK_DROP_MEMBERSHIP, [1], 4) = 0
... which triggers 'WARN_ON_ONCE(nfnlnet->ctnetlink_listeners == 0)' check.
Instead of counting, just enable reporting for every bind request
and check if we still have listeners on unbind.
While at it, also add the needed bounds check on nfnl_group2type[]
access.
Reported-by: <[email protected]>
Reported-by: <[email protected]>
Fixes: 2794cdb0b97b ("netfilter: nfnetlink: allow to detect if ctnetlink listeners exist")
Signed-off-by: Florian Westphal <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions