]> git.baikalelectronics.ru Git - kernel.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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 8 Sep 2020 11:04:51 +0000 (13:04 +0200)
commit497a04224357c3f44fbc6c543904c780cc1a9529
tree6f3d07e486bd69f2b2c68a4578f978d4ced5463b
parent4cec97eb5397fd89c08a1880e842b23ac1c88962
netfilter: ctnetlink: fix mark based dump filtering regression

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: 9127563e6a41 ("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>
net/netfilter/nf_conntrack_netlink.c