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:07:50 +0000 (11:07 +0100)
commitf25f048d3bde992239b7e019467b4fb4832bac99
treebc82edf2cb74348ec2a5959363baed28bf380507
parent6609d112229fff5dbccf57bbc31facffc1ba06dd
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