]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: x_tables: fix compat match/target pad out-of-bound write
authorFlorian Westphal <fw@strlen.de>
Wed, 7 Apr 2021 19:38:57 +0000 (21:38 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Apr 2021 22:18:57 +0000 (00:18 +0200)
commitb85041204c1a3534c63ef8da68e6d25d8d4c900e
treea2cabc721228fc1d876374aac3bd7758d4016165
parent3706a0e2f8a9ddc19e79861e026c0f04f9b2c245
netfilter: x_tables: fix compat match/target pad out-of-bound write

xt_compat_match/target_from_user doesn't check that zeroing the area
to start of next rule won't write past end of allocated ruleset blob.

Remove this code and zero the entire blob beforehand.

Reported-by: syzbot+cfc0247ac173f597aaaa@syzkaller.appspotmail.com
Reported-by: Andy Nguyen <theflow@google.com>
Fixes: 23ad4d8c5483f ("[NETFILTER]: x_tables: simplify compat API")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/ip_tables.c
net/ipv6/netfilter/ip6_tables.c
net/netfilter/x_tables.c