Commit 1567d4f
committed
netfilter: nf_tables: fix spurious set element insertion failure
jira VUlN-429
subsystem-sync netfilter:nf_tables 4.18.0-511
commit-author Florian Westphal <[email protected]>
commit ddbd8be
On some platforms there is a padding hole in the nft_verdict
structure, between the verdict code and the chain pointer.
On element insertion, if the new element clashes with an existing one and
NLM_F_EXCL flag isn't set, we want to ignore the -EEXIST error as long as
the data associated with duplicated element is the same as the existing
one. The data equality check uses memcmp.
For normal data (NFT_DATA_VALUE) this works fine, but for NFT_DATA_VERDICT
padding area leads to spurious failure even if the verdict data is the
same.
This then makes the insertion fail with 'already exists' error, even
though the new "key : data" matches an existing entry and userspace
told the kernel that it doesn't want to receive an error indication.
Fixes: c016c7e ("netfilter: nf_tables: honor NLM_F_EXCL flag in set element insertion")
Signed-off-by: Florian Westphal <[email protected]>
(cherry picked from commit ddbd8be)
Signed-off-by: Greg Rose <[email protected]>1 parent 3e5770b commit 1567d4f
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8727 | 8727 | | |
8728 | 8728 | | |
8729 | 8729 | | |
| 8730 | + | |
| 8731 | + | |
| 8732 | + | |
8730 | 8733 | | |
8731 | 8734 | | |
8732 | 8735 | | |
| |||
0 commit comments