]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: cttimeout: fix slab-out-of-bounds read in cttimeout_net_exit
authorFlorian Westphal <fw@strlen.de>
Thu, 19 May 2022 22:02:05 +0000 (00:02 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 27 May 2022 09:16:38 +0000 (11:16 +0200)
commit107987e8f8c8ec66d0cc110b90e47b08d4a6f764
tree46390862220007597bfe6d217b33bd5dfbd371c7
parent1ff72fc943415569e58eddd4de7c6b0dbd8000ee
netfilter: cttimeout: fix slab-out-of-bounds read in cttimeout_net_exit

syzbot reports:
BUG: KASAN: slab-out-of-bounds in __list_del_entry_valid+0xcc/0xf0 lib/list_debug.c:42
[..]
 list_del include/linux/list.h:148 [inline]
 cttimeout_net_exit+0x211/0x540 net/netfilter/nfnetlink_cttimeout.c:617

No reproducer so far. Looking at recent changes in this area
its clear that the free_head must not be at the end of the
structure because nf_ct_timeout structure has variable size.

Reported-by: <syzbot+92968395eedbdbd3617d@syzkaller.appspotmail.com>
Fixes: 7336c1976b8c ("netfilter: cttimeout: decouple unlink and free on netns destruction")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nfnetlink_cttimeout.c