OSDN Git Service

netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}
authorEric Dumazet <edumazet@google.com>
Thu, 25 Jan 2018 01:16:09 +0000 (17:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Feb 2018 10:03:36 +0000 (11:03 +0100)
commit4556b01a0a559ee8fec3615acb47b8825f8e2ba9
tree4480d989996dfb1b761e41823334893f9773de7b
parent9626ac658a19f9863da04c0727e0b5c32175cc04
netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}

commit da17c73b6eb74aad3c3c0654394635675b623b3e upstream.

It looks like syzbot found its way into netfilter territory.

Issue here is that @name comes from user space and might
not be null terminated.

Out-of-bound reads happen, KASAN is not happy.

v2 added similar fix for xt_request_find_target(),
as Florian advised.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/netfilter/x_tables.c