summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2022-02-28 06:22:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-03-08 19:04:07 +0100
commit34dc4a6a7f261736ef7183868a5bddad31c7f9e3 (patch)
treecaad7ef82a3b6b94bc3ef716e8a0f1b14da48d96 /include/net
parent6d9719ef61a99d1ed750b510d32620a6c4bb7397 (diff)
downloadlinux-stable-34dc4a6a7f261736ef7183868a5bddad31c7f9e3.tar.gz
linux-stable-34dc4a6a7f261736ef7183868a5bddad31c7f9e3.tar.bz2
linux-stable-34dc4a6a7f261736ef7183868a5bddad31c7f9e3.zip
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>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/netfilter/nf_queue.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index a50a69f5334c..861414a62ce1 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -32,7 +32,7 @@ void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *q
void nf_unregister_queue_handler(struct net *net);
void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
-void nf_queue_entry_get_refs(struct nf_queue_entry *entry);
+bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
static inline void init_hashrandom(u32 *jhash_initval)