]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_queue: don't assume sk is full socket
authorFlorian Westphal <fw@strlen.de>
Fri, 25 Feb 2022 13:02:41 +0000 (14:02 +0100)
committerFlorian Westphal <fw@strlen.de>
Tue, 1 Mar 2022 10:48:18 +0000 (11:48 +0100)
commit747670fd9a2d1b7774030dba65ca022ba442ce71
tree55bcfe9e9cbaf2adc31675dbd78ec97ffb612e11
parent17a8f31bba7bac8cce4bd12bab50697da96e7710
netfilter: nf_queue: don't assume sk is full socket

There is no guarantee that state->sk refers to a full socket.

If refcount transitions to 0, sock_put calls sk_free which then ends up
with garbage fields.

I'd like to thank Oleksandr Natalenko and Jiri Benc for considerable
debug work and pointing out state->sk oddities.

Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener")
Tested-by: Oleksandr Natalenko <oleksandr@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nf_queue.c