]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: xt_owner: Fix for unsafe access of sk->sk_socket
authorPhil Sutter <phil@nwl.cc>
Tue, 5 Dec 2023 20:58:12 +0000 (21:58 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 6 Dec 2023 16:52:15 +0000 (17:52 +0100)
commit7ae836a3d630e146b732fe8ef7d86b243748751f
treee7de314a4b70b89d256168aa8fb078de3c7117aa
parentf6e1532a2697b81da00bfb184e99d15e01e9d98c
netfilter: xt_owner: Fix for unsafe access of sk->sk_socket

A concurrently running sock_orphan() may NULL the sk_socket pointer in
between check and deref. Follow other users (like nft_meta.c for
instance) and acquire sk_callback_lock before dereferencing sk_socket.

Fixes: 0265ab44bacc ("[NETFILTER]: merge ipt_owner/ip6t_owner in xt_owner")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/xt_owner.c