netfilter: nft_socket: make cgroup match work in input too
authorFlorian Westphal <fw@strlen.de>
Sat, 9 Apr 2022 11:20:19 +0000 (13:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2022 07:34:10 +0000 (09:34 +0200)
commit1c86b7ea63ff059907fb7b2829fd17feda9740e7
tree16ebaf3df37153af4e5711169b6881ba3384e64e
parent5a52384a513462a16335a26b9082b8a0edb24cda
netfilter: nft_socket: make cgroup match work in input too

[ Upstream commit 05ae2fba821c4d122ab4ba3e52144e21586c4010 ]

cgroupv2 helper function ignores the already-looked up sk
and uses skb->sk instead.

Just pass sk from the calling function instead; this will
make cgroup matching work for udp and tcp in input even when
edemux did not set skb->sk already.

Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2")
Signed-off-by: Florian Westphal <fw@strlen.de>
Tested-by: Topi Miettinen <toiwoton@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_socket.c