netfilter: xt_socket: fix a stack corruption bug
authorEric Dumazet <edumazet@google.com>
Mon, 16 Feb 2015 03:03:45 +0000 (19:03 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:18 +0000 (23:16 +0100)
commit9420e955c943fca376b90be12af248b7299780ac
tree6e7f6a76ce4a601687aa995b8779df9393297117
parent1e5bf5ca07dd5cb37b491074e6050b5633bf4c5a
netfilter: xt_socket: fix a stack corruption bug

commit 78296c97ca1fd3b104f12e1f1fbc06c46635990b upstream.

As soon as extract_icmp6_fields() returns, its local storage (automatic
variables) is deallocated and can be overwritten.

Lets add an additional parameter to make sure storage is valid long
enough.

While we are at it, adds some const qualifiers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: b64c9256a9b76 ("tproxy: added IPv6 support to the socket match")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/netfilter/xt_socket.c