[LTS 8.6] netfilter: nf_tables: Reject tables of unsupported family #438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[LTS 8.6]
CVE-2023-6040
VULN-8162
Problem
https://www.openwall.com/lists/oss-security/2024/01/12/1
Applicability: yes
nf_tables
are enabled in LTS 8.6:The fixing commit f1082dd is not present in the affected file's
net/netfilter/nf_tables_api.c
history forciqlts8_6
, nor was it backported.The bug can't be blamed on a single commit - there is no "fixes" commit indicated in f1082dd to check whether it exists in
ciqlts8_6
history or not. However, without replicating Ant Security Lab's analysis it can be reasonably assumed that the bug is present in LTS 8.6 based on the following arguments:ciqlts8_6
kernel 4.18 is vulnerable.xt_find_target
function exists innet/netfilter/x_tables.c
and it does dereference thext
array a couple of times without boundary checking:kernel-src-tree/net/netfilter/x_tables.c
Line 238 in a5f217e
kernel-src-tree/net/netfilter/x_tables.c
Line 239 in a5f217e
kernel-src-tree/net/netfilter/x_tables.c
Line 243 in a5f217e
kernel-src-tree/net/netfilter/x_tables.c
Line 250 in a5f217e
nf_logger_find_get
function exists innet/netfilter/nf_log.c
and the globalloggers
variable is dereferenced withpf
kernel-src-tree/net/netfilter/nf_log.c
Line 173 in a5f217e
Solution
Naively cherry-picking the f1082dd commit leads to many conflicts but they aren't indicative of any semantic mismatches between the patch and
net/netfilter/nf_tables_api.c
file underciqlts8_6
revision. The changes were applied manually as they appear in the diff.kABI check: passed
Boot test: passed
boot-test.log
Kselftests: passed relative
Coverage
The patch is contained within the
netfilter
subsystem which has its dedicated test suite - all thenetfilter:*
tests were picked for testing.Reference
kselftests–ciqlts8_6–run1.log
kselftests–ciqlts8_6–run2.log
kselftests–ciqlts8_6–run3.log
kselftests–ciqlts8_6–run4.log
Patch
kselftests–ciqlts8_6-CVE-2023-6040–run1.log
kselftests–ciqlts8_6-CVE-2023-6040–run2.log
kselftests–ciqlts8_6-CVE-2023-6040–run3.log
Comparison
The reference and patch tests results are the same
Specific tests: skipped