]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
netfilter: ctnetlink: fix mark based dump filtering regression
authorMartin Willi <martin@strongswan.org>
Tue, 1 Sep 2020 06:56:19 +0000 (08:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 15:36:27 +0000 (17:36 +0200)
commite38f49e00baf15d6eae9377647e15fc0962cf8cb
treecbf1358d09fc86113c342d3660e57e2a4b2820ce
parent24c4f2ae019bfcd2a82783e07c2894a519eb1050
netfilter: ctnetlink: fix mark based dump filtering regression

[ Upstream commit 6c0d95d1238d944fe54f0bbfc7ec017d78435daa ]

conntrack mark based dump filtering may falsely skip entries if a mask
is given: If the mask-based check does not filter out the entry, the
else-if check is always true and compares the mark without considering
the mask. The if/else-if logic seems wrong.

Given that the mask during filter setup is implicitly set to 0xffffffff
if not specified explicitly, the mark filtering flags seem to just
complicate things. Restore the previously used approach by always
matching against a zero mask is no filter mark is given.

Fixes: cb8aa9a3affb ("netfilter: ctnetlink: add kernel side filtering for dump")
Signed-off-by: Martin Willi <martin@strongswan.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_netlink.c