netfilter: br_netfilter: fix recent physdev match breakage
authorFlorian Westphal <fw@strlen.de>
Mon, 3 Apr 2023 11:54:37 +0000 (13:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Apr 2023 12:28:32 +0000 (14:28 +0200)
commitea854a25c8327f51f7ff529b745794a985185563
treed675f346272383d7c99820669d740bdc782c9e6b
parent6369276efa7a7dea8f366235a77c6137b096d29b
netfilter: br_netfilter: fix recent physdev match breakage

[ Upstream commit 94623f579ce338b5fa61b5acaa5beb8aa657fb9e ]

Recent attempt to ensure PREROUTING hook is executed again when a
decrypted ipsec packet received on a bridge passes through the network
stack a second time broke the physdev match in INPUT hook.

We can't discard the nf_bridge info strct from sabotage_in hook, as
this is needed by the physdev match.

Keep the struct around and handle this with another conditional instead.

Fixes: 2b272bb558f1 ("netfilter: br_netfilter: disable sabotage_in hook after first suppression")
Reported-and-tested-by: Farid BENAMROUCHE <fariouche@yahoo.fr>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/skbuff.h
net/bridge/br_netfilter_hooks.c