]> git.baikalelectronics.ru Git - kernel.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)
committerFlorian Westphal <fw@strlen.de>
Tue, 1 Mar 2022 10:50:35 +0000 (11:50 +0100)
commita52dbfb5372271438f1b7f94a18f84aed071d76a
treeda192a08d0f995eaa2854d5033279ace339f2bcf
parent043d9377d59e186182ab0e67e6baf56ea7d4af8e
netfilter: nf_queue: fix possible use-after-free

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: 984b685a7c2bb ("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>
include/net/netfilter/nf_queue.h
net/netfilter/nf_queue.c
net/netfilter/nfnetlink_queue.c