]> git.ipfire.org Git - people/ms/linux.git/commit
netfilter: nf_queue: fix possible use-after-free
authorFlorian Westphal <fw@strlen.de>
Mon, 28 Feb 2022 05:22:22 +0000 (06:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:45 +0000 (19:12 +0100)
commitdd648bd1b33a828f62befa696b206c688da0ec43
tree17476d7122f9c67839fc3c36dfbde9f605ac4b87
parent63291e95e8ae6798488bc93ab8cecd4e11c0cf1b
netfilter: nf_queue: fix possible use-after-free

commit c3873070247d9e3c7a6b0cf9bf9b45e8018427b1 upstream.

Eric Dumazet says:
  The sock_hold() side seems suspect, because there is no guarantee
  that sk_refcnt is not already 0.

On failure, we cannot queue the packet and need to indicate an
error.  The packet will be dropped by the caller.

v2: split skb prefetch hunk into separate change

Fixes: 271b72c7fa82c ("udp: RCU handling for Unicast packets.")
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/netfilter/nf_queue.h
net/netfilter/nf_queue.c
net/netfilter/nfnetlink_queue.c