Skip to content

Conversation

@pvts-mat
Copy link
Contributor

CVE-2024-0607 VULN-42268
CVE-2024-0193 VULN-6825
CVE-2024-42109 VULN-44483
CVE-2024-54031 VULN-5468

About

This PR aims to supplement the netfilter patch set #668 regarding the omitted bugfixes.

Unlike in the previous PR the CentOS 9 branches were not backported in full, instead just single commits were picked addressing specific issues. This approach was chosen because the main branches of concern - f875124, 3e3b830 - were loosely coupled and none of the picks required prerequisites.

Previous netfilter PR bugfixes

The following list follows the table from comment #668 (comment) thus indirectly addressing all [FIXES] warnings indicated in #668 (comment).

8daa8fd netfilter: nf_tables: Introduce NFT_MSG_GETRULE_RESET

[FIXES] PR commit 6ae8fd31e0a9 (netfilter: nf_tables: Introduce
        NFT_MSG_GETRULE_RESET) references upstream commit 8daa8fde3fc3, which
        has Fixes tags:

    ea078ae9108e netfilter: nf_tables: Audit log rule reset (Phil Sutter)

This commit was eventually omitted in the second revision of the PR, so the fix doesn't apply.

f80a612 netfilter: nf_tables: add support to destroy operation

[FIXES] PR commit a4771f950250 (netfilter: nf_tables: add support to destroy
        operation) references upstream commit f80a612dd77c, which has Fixes
        tags:

    a7d5a955bfa8 netfilter: nf_tables: bogus ENOENT when destroying element which does not exist (Pablo Neira Ayuso)

This commit was eventually omitted in the second revision of the PR, so the fix doesn't apply.

079cd63 netfilter: nf_tables: Introduce NFT_MSG_GETSETELEM_RESET

[FIXES] PR commit b39b3ba76ed5 (netfilter: nf_tables: Introduce
        NFT_MSG_GETSETELEM_RESET) references upstream commit 079cd633219d, which
        has Fixes tags:

    4c90bba60c26 netfilter: nf_tables: do not refresh timeout when resetting element (Pablo Neira Ayuso)
    7e9be1124dbe netfilter: nf_tables: Audit log setelem reset (Phil Sutter)

This commit was eventually omitted in the second revision of the PR, so the fixes don't apply.

212ed75 netfilter: nf_tables: integrate pipapo into commit protocol

[FIXES] PR commit dfc61266e1a1 (netfilter: nf_tables: integrate pipapo into
        commit protocol) references upstream commit 212ed75dc5fb, which has
        Fixes tags:

    ebd032fa8818 netfilter: nf_tables: do not remove elements if set backend implements .abort (Pablo Neira Ayuso)

The fixing commit ebd032f was later reverted in the upstream with f86fb94. The fix may therefore be considered void.

2b84e21 netfilter: nft_set_pipapo: .walk does not deal with generations

[FIXES] PR commit ba24727bdd7b (netfilter: nft_set_pipapo: .walk does not deal
        with generations) references upstream commit 2b84e215f874, which has
        Fixes tags:

    29b359cf6d95 netfilter: nft_set_pipapo: walk over current view on netlink dump (Pablo Neira Ayuso) (CVE-2024-27017)

This fix will be covered in a separate PR along with the CVE-2024-27012 fix. See below.

628bd3e netfilter: nf_tables: drop map element references from preparation phase

[FIXES] PR commit 70c31adf2efe (netfilter: nf_tables: drop map element
        references from preparation phase) references upstream commit
        628bd3e49cba, which has Fixes tags:

    e79b47a8615d netfilter: nf_tables: restore set elements when delete set fails (Pablo Neira Ayuso) (CVE-2024-27012)

The fix requires extensive adaptations to ciqlts9_2 which could not have been avoided with a reasonable number of prerequisites. It was decided to leave it for a separate PR.

5f68718 netfilter: nf_tables: GC transaction API to avoid race with control plane

[FIXES] PR commit 66663eb40599 (netfilter: nf_tables: GC transaction API to
        avoid race with control plane) references upstream commit 5f68718b34a5,
        which has Fixes tags:

    6b1ca88e4bb6 netfilter: nf_tables: skip dead set elements in netlink dump (Pablo Neira Ayuso)
    08e4c8c5919f netfilter: nf_tables: mark newset as dead on transaction abort (Florian Westphal)
    7315dc1e122c netfilter: nf_tables: skip set commit for deleted/destroyed sets (Pablo Neira Ayuso)

All fixes were included in the PR.

netfilter: nf_tables: skip dead set elements in netlink dump

jira VULN-430
cve-bf CVE-2023-4244
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 6b1ca88e4bb63673dc9f9c7f23c899f22c3cb17a
netfilter: nf_tables: mark newset as dead on transaction abort

jira VULN-430
subsystem-update centos-stream-9 f8751245d3174ab38a11084355955fdf8ff4d53d
cve-bf CVE-2023-4244
commit-author Florian Westphal <fw@strlen.de>
commit 08e4c8c5919fd405a4d709b4ba43d836894a26eb
netfilter: nf_tables: skip set commit for deleted/destroyed sets

jira VULN-6825
subsystem-update centos-stream-9 f8751245d3174ab38a11084355955fdf8ff4d53d
cve CVE-2024-0193
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 7315dc1e122c85ffdfc8defffbb8f8b616c2eb1a

f6c383b netfilter: nf_tables: adapt set backend to use GC transaction API

[FIXES] PR commit 893218018f7d (netfilter: nf_tables: adapt set backend to use
        GC transaction API) references upstream commit f6c383b8c31a, which has
        Fixes tags:

    7ffc7481153b netfilter: nft_set_hash: skip duplicated elements pending gc run (Pablo Neira Ayuso)
    ffb40fba4045 netfilter: nft_set_pipapo: prefer gfp_kernel allocation (Florian Westphal)

All fixes were included in the PR.

netfilter: nft_set_pipapo: prefer gfp_kernel allocation

jira VULN-158865
subsystem-update centos-stream-9 f8751245d3174ab38a11084355955fdf8ff4d53d
cve-bf CVE-2023-52923
commit-author Florian Westphal <fw@strlen.de>
commit ffb40fba404561f141d37e5878ec542b67464d74
netfilter: nft_set_hash: skip duplicated elements pending gc run

jira VULN-158865
cve-bf CVE-2023-52923
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 7ffc7481153bbabf3332c6a19b289730c7e1edf5

The bugfix of netfilter: nft_set_hash: skip duplicated elements pending gc run, with a separate CVE:

netfilter: nft_set_hash: unaligned atomic read on struct nft_set_ext

jira VULN-5468
cve CVE-2024-54031
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 542ed8145e6f9392e3d0a86a0e9027d2ffd183e4

2c9f029 netfilter: nf_tables: flush pending destroy work before netlink notifier

[FIXES] PR commit 63df5313037e (netfilter: nf_tables: flush pending destroy work
        before netlink notifier) references upstream commit 2c9f0293280e, which
        has Fixes tags:

    9f6958ba2e90 netfilter: nf_tables: unconditionally flush pending work before notifier (Florian Westphal) (CVE-2024-42109)

The fix was included in the PR.

netfilter: nf_tables: unconditionally flush pending work before notifier

jira VULN-44483
cve CVE-2024-42109
commit-author Florian Westphal <fw@strlen.de>
commit 9f6958ba2e902f9820c594869bd710ba74b7c4c0
netfilter: nf_tables: make destruction work queue pernet

jira VULN-44483
cve-bf CVE-2024-42109
commit-author Florian Westphal <fw@strlen.de>
commit fb8286562ecfb585e26b033c5e32e6fb85efb0b3
upstream-diff Context conflicts only

9dad402 netfilter: nf_tables: expose opaque set element as struct nft_elem_priv

[FIXES] PR commit a35dbfa4febc (netfilter: nf_tables: expose opaque set element
        as struct nft_elem_priv) references upstream commit 9dad402b89e8, which
        has Fixes tags:

    ab0beafd52b9 netfilter: nft_set_pipapo: remove static in nft_pipapo_get() (Pablo Neira Ayuso)

The fix was included in the PR.

netfilter: nft_set_pipapo: remove static in nft_pipapo_get()

jira VULN-430
cve-bf CVE-2023-4244
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit ab0beafd52b98dfb8b8244b2c6794efbc87478db

Additional fixes

Additional fix was included, which doesn't address any specific commit from the netfilter PR, but has CVE-2024-0607 assigned and is part of the CentOS 9 branch f875124 being (partially) backported here with the fixes 7315dc1, 08e4c8c and ffb40fb.

netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()

jira VULN-42268
subsystem-update centos-stream-9 f8751245d3174ab38a11084355955fdf8ff4d53d
cve CVE-2024-0607
commit-author Florian Westphal <fwestpha@redhat.com>
commit c301f0981fdd3fd1ffac6836b423c4d7a8e0eb63
upstream-diff ciqlts9_4 backport e7fce923c6297083b2248349a26eeb5d800f576e used
  for clean cherry-pick

kABI check: passed

[1/2] kabi_check_kernel	Check ABI of kernel [ciqlts9_2-CVE-batch-14]	_kabi_check_kernel__x86_64--test--ciqlts9_2-CVE-batch-14
++ uname -m
+ python3 /data/src/ctrliq-github-haskell/kernel-dist-git-el-9.2/SOURCES/check-kabi -k /data/src/ctrliq-github-haskell/kernel-dist-git-el-9.2/SOURCES/Module.kabi_x86_64 -s vms/x86_64--build--ciqlts9_2/build_files/kernel-src-tree-ciqlts9_2-CVE-batch-14/Module.symvers
kABI check passed
+ touch state/kernels/ciqlts9_2-CVE-batch-14/x86_64/kabi_checked

Boot test: passed

boot-test.log

Kselftests: passed

Reference

kselftests–ciqlts9_2–run1.log
kselftests–ciqlts9_2–run2.log

Patch

kselftests–ciqlts9_2-CVE-batch-14–run1.log
kselftests–ciqlts9_2-CVE-batch-14–run2.log
kselftests–ciqlts9_2-CVE-batch-14–run3.log
kselftests–ciqlts9_2-CVE-batch-14–run4.log
kselftests–ciqlts9_2-CVE-batch-14–run5.log

Comparison

The tests results for the reference and the patch are the same.

$ ktests.xsh diff  kselftests*.log

Column    File
--------  --------------------------------------------
Status0   kselftests--ciqlts9_2--run1.log
Status1   kselftests--ciqlts9_2--run2.log
Status2   kselftests--ciqlts9_2-CVE-batch-14--run1.log
Status3   kselftests--ciqlts9_2-CVE-batch-14--run2.log
Status4   kselftests--ciqlts9_2-CVE-batch-14--run3.log
Status5   kselftests--ciqlts9_2-CVE-batch-14--run4.log
Status6   kselftests--ciqlts9_2-CVE-batch-14--run5.log

TestCase                              Status0  Status1  Status2  Status3  Status4  Status5  Status6  Summary
netfilter:conntrack_icmp_related.sh   pass     pass     pass     pass     pass     pass     pass     same
netfilter:conntrack_tcp_unreplied.sh  pass     pass     pass     pass     pass     pass     pass     same
netfilter:conntrack_vrf.sh            pass     pass     pass     pass     pass     pass     pass     same
netfilter:ipip-conntrack-mtu.sh       pass     pass     pass     pass     pass     pass     pass     same
netfilter:ipvs.sh                     pass     pass     pass     pass     pass     pass     pass     same
netfilter:nf_nat_edemux.sh            pass     pass     pass     pass     pass     pass     pass     same
netfilter:nft_conntrack_helper.sh     pass     pass     pass     pass     pass     pass     pass     same
netfilter:nft_fib.sh                  pass     pass     pass     pass     pass     pass     pass     same
netfilter:nft_meta.sh                 pass     pass     pass     pass     pass     pass     pass     same
netfilter:nft_nat.sh                  pass     pass     pass     pass     pass     pass     pass     same
netfilter:nft_queue.sh                pass     pass     pass     pass     pass     pass     pass     same
netfilter:rpath.sh                    pass     pass     pass     pass     pass     pass     pass     same

jira VULN-42268
subsystem-update centos-stream-9 f875124
cve CVE-2024-0607
commit-author Florian Westphal <fwestpha@redhat.com>
commit c301f09
upstream-diff ciqlts9_4 backport e7fce92 used
  for clean cherry-pick

netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()

The problem is in nft_byteorder_eval() where we are iterating through a
loop and writing to dst[0], dst[1], dst[2] and so on...  On each
iteration we are writing 8 bytes.  But dst[] is an array of u32 so each
element only has space for 4 bytes.  That means that every iteration
overwrites part of the previous element.

I spotted this bug while reviewing commit caf3ef7 ("netfilter:
nf_tables: prevent OOB access in nft_byteorder_eval") which is a related
issue.  I think that the reason we have not detected this bug in testing
is that most of time we only write one element.

Fixes: ce1e798 ("netfilter: nft_byteorder: provide 64bit le/be conversion")
	Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit e7fce92)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-6825
subsystem-update centos-stream-9 f875124
cve CVE-2024-0193
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 7315dc1

NFT_MSG_DELSET deactivates all elements in the set, skip
set->ops->commit() to avoid the unnecessary clone (for the pipapo case)
as well as the sync GC cycle, which could deactivate again expired
elements in such set.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Reported-by: Kevin Rich <kevinrich1337@gmail.com>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 7315dc1)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-430
subsystem-update centos-stream-9 f875124
cve-bf CVE-2023-4244
commit-author Florian Westphal <fw@strlen.de>
commit 08e4c8c

If a transaction is aborted, we should mark the to-be-released NEWSET dead,
just like commit path does for DEL and DESTROYSET commands.

In both cases all remaining elements will be released via
set->ops->destroy().

The existing abort code does NOT post the actual release to the work queue.
Also the entire __nf_tables_abort() function is wrapped in gc_seq
begin/end pair.

Therefore, async gc worker will never try to release the pending set
elements, as gc sequence is always stale.

It might be possible to speed up transaction aborts via work queue too,
this would result in a race and a possible use-after-free.

So fix this before it becomes an issue.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Signed-off-by: Florian Westphal <fw@strlen.de>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 08e4c8c)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158865
subsystem-update centos-stream-9 f875124
cve-bf CVE-2023-52923
commit-author Florian Westphal <fw@strlen.de>
commit ffb40fb

No need to use GFP_ATOMIC here.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Signed-off-by: Florian Westphal <fw@strlen.de>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit ffb40fb)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-430
cve-bf CVE-2023-4244
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 6b1ca88

Delete from packet path relies on the garbage collector to purge
elements with NFT_SET_ELEM_DEAD_BIT on.

Skip these dead elements from nf_tables_dump_setelem() path, I very
rarely see tests/shell/testcases/maps/typeof_maps_add_delete reports
[DUMP FAILED] showing a mismatch in the expected output with an element
that should not be there.

If the netlink dump happens before GC worker run, it might show dead
elements in the ruleset listing.

nft_rhash_get() already skips dead elements in nft_rhash_cmp(),
therefore, it already does not show the element when getting a single
element via netlink control plane.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 6b1ca88)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-430
cve-bf CVE-2023-4244
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit ab0beaf

This has slipped through when reducing memory footprint for set
elements, remove it.

Fixes: 9dad402 ("netfilter: nf_tables: expose opaque set element as struct nft_elem_priv")
	Reported-by: Florian Westphal <fw@strlen.de>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit ab0beaf)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-44483
cve CVE-2024-42109
commit-author Florian Westphal <fw@strlen.de>
commit 9f6958b

syzbot reports:

KASAN: slab-uaf in nft_ctx_update include/net/netfilter/nf_tables.h:1831
KASAN: slab-uaf in nft_commit_release net/netfilter/nf_tables_api.c:9530
KASAN: slab-uaf int nf_tables_trans_destroy_work+0x152b/0x1750 net/netfilter/nf_tables_api.c:9597
Read of size 2 at addr ffff88802b0051c4 by task kworker/1:1/45
[..]
Workqueue: events nf_tables_trans_destroy_work
Call Trace:
 nft_ctx_update include/net/netfilter/nf_tables.h:1831 [inline]
 nft_commit_release net/netfilter/nf_tables_api.c:9530 [inline]
 nf_tables_trans_destroy_work+0x152b/0x1750 net/netfilter/nf_tables_api.c:9597

Problem is that the notifier does a conditional flush, but its possible
that the table-to-be-removed is still referenced by transactions being
processed by the worker, so we need to flush unconditionally.

We could make the flush_work depend on whether we found a table to delete
in nf-next to avoid the flush for most cases.

AFAICS this problem is only exposed in nf-next, with
commit e169285 ("netfilter: nf_tables: do not store nft_ctx in transaction objects"),
with this commit applied there is an unconditional fetch of
table->family which is whats triggering the above splat.

Fixes: 2c9f029 ("netfilter: nf_tables: flush pending destroy work before netlink notifier")
Reported-and-tested-by: syzbot+4fd66a69358fc15ae2ad@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4fd66a69358fc15ae2ad
	Signed-off-by: Florian Westphal <fw@strlen.de>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 9f6958b)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-44483
cve-bf CVE-2024-42109
commit-author Florian Westphal <fw@strlen.de>
commit fb82865
upstream-diff Context conflicts only

The call to flush_work before tearing down a table from the netlink
notifier was supposed to make sure that all earlier updates (e.g. rule
add) that might reference that table have been processed.

Unfortunately, flush_work() waits for the last queued instance.
This could be an instance that is different from the one that we must
wait for.

This is because transactions are protected with a pernet mutex, but the
work item is global, so holding the transaction mutex doesn't prevent
another netns from queueing more work.

Make the work item pernet so that flush_work() will wait for all
transactions queued from this netns.

A welcome side effect is that we no longer need to wait for transaction
objects from foreign netns.

The gc work queue is still global.  This seems to be ok because nft_set
structures are reference counted and each container structure owns a
reference on the net namespace.

The destroy_list is still protected by a global spinlock rather than
pernet one but the hold time is very short anyway.

v2: call cancel_work_sync before reaping the remaining tables (Pablo).

Fixes: 9f6958b ("netfilter: nf_tables: unconditionally flush pending work before notifier")
	Reported-by: syzbot+5d8c5789c8cb076b2c25@syzkaller.appspotmail.com
	Signed-off-by: Florian Westphal <fw@strlen.de>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit fb82865)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-158865
cve-bf CVE-2023-52923
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 7ffc748

rhashtable does not provide stable walk, duplicated elements are
possible in case of resizing. I considered that checking for errors when
calling rhashtable_walk_next() was sufficient to detect the resizing.
However, rhashtable_walk_next() returns -EAGAIN only at the end of the
iteration, which is too late, because a gc work containing duplicated
elements could have been already scheduled for removal to the worker.

Add a u32 gc worker sequence number per set, bump it on every workqueue
run. Annotate gc worker sequence number on the expired element. Use it
to skip those already seen in this gc workqueue run.

Note that this new field is never reset in case gc transaction fails, so
next gc worker run on the expired element overrides it. Wraparound of gc
worker sequence number should not be an issue with stale gc worker
sequence number in the element, that would just postpone the element
removal in one gc run.

Note that it is not possible to use flags to annotate that element is
pending gc run to detect duplicates, given that gc transaction can be
invalidated in case of update from the control plane, therefore, not
allowing to clear such flag.

On x86_64, pahole reports no changes in the size of nft_rhash_elem.

Fixes: f6c383b ("netfilter: nf_tables: adapt set backend to use GC transaction API")
	Reported-by: Laurent Fasnacht <laurent.fasnacht@proton.ch>
	Tested-by: Laurent Fasnacht <laurent.fasnacht@proton.ch>
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 7ffc748)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
jira VULN-5468
cve CVE-2024-54031
commit-author Pablo Neira Ayuso <pablo@netfilter.org>
commit 542ed81

Access to genmask field in struct nft_set_ext results in unaligned
atomic read:

[   72.130109] Unable to handle kernel paging request at virtual address ffff0000c2bb708c
[   72.131036] Mem abort info:
[   72.131213]   ESR = 0x0000000096000021
[   72.131446]   EC = 0x25: DABT (current EL), IL = 32 bits
[   72.132209]   SET = 0, FnV = 0
[   72.133216]   EA = 0, S1PTW = 0
[   72.134080]   FSC = 0x21: alignment fault
[   72.135593] Data abort info:
[   72.137194]   ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000
[   72.142351]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   72.145989]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   72.150115] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000237d27000
[   72.154893] [ffff0000c2bb708c] pgd=0000000000000000, p4d=180000023ffff403, pud=180000023f84b403, pmd=180000023f835403,
+pte=0068000102bb7707
[   72.163021] Internal error: Oops: 0000000096000021 [ctrliq#1] SMP
[...]
[   72.170041] CPU: 7 UID: 0 PID: 54 Comm: kworker/7:0 Tainted: G            E      6.13.0-rc3+ ctrliq#2
[   72.170509] Tainted: [E]=UNSIGNED_MODULE
[   72.170720] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-stable202302-for-qemu 03/01/2023
[   72.171192] Workqueue: events_power_efficient nft_rhash_gc [nf_tables]
[   72.171552] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
[   72.171915] pc : nft_rhash_gc+0x200/0x2d8 [nf_tables]
[   72.172166] lr : nft_rhash_gc+0x128/0x2d8 [nf_tables]
[   72.172546] sp : ffff800081f2bce0
[   72.172724] x29: ffff800081f2bd40 x28: ffff0000c2bb708c x27: 0000000000000038
[   72.173078] x26: ffff0000c6780ef0 x25: ffff0000c643df00 x24: ffff0000c6778f78
[   72.173431] x23: 000000000000001a x22: ffff0000c4b1f000 x21: ffff0000c6780f78
[   72.173782] x20: ffff0000c2bb70dc x19: ffff0000c2bb7080 x18: 0000000000000000
[   72.174135] x17: ffff0000c0a4e1c0 x16: 0000000000003000 x15: 0000ac26d173b978
[   72.174485] x14: ffffffffffffffff x13: 0000000000000030 x12: ffff0000c6780ef0
[   72.174841] x11: 0000000000000000 x10: ffff800081f2bcf8 x9 : ffff0000c3000000
[   72.175193] x8 : 00000000000004be x7 : 0000000000000000 x6 : 0000000000000000
[   72.175544] x5 : 0000000000000040 x4 : ffff0000c3000010 x3 : 0000000000000000
[   72.175871] x2 : 0000000000003a98 x1 : ffff0000c2bb708c x0 : 0000000000000004
[   72.176207] Call trace:
[   72.176316]  nft_rhash_gc+0x200/0x2d8 [nf_tables] (P)
[   72.176653]  process_one_work+0x178/0x3d0
[   72.176831]  worker_thread+0x200/0x3f0
[   72.176995]  kthread+0xe8/0xf8
[   72.177130]  ret_from_fork+0x10/0x20
[   72.177289] Code: 54fff984 d503201f d2800080 91003261 (f820303f)
[   72.177557] ---[ end trace 0000000000000000 ]---

Align struct nft_set_ext to word size to address this and
documentation it.

pahole reports that this increases the size of elements for rhash and
pipapo in 8 bytes on x86_64.

Fixes: 7ffc748 ("netfilter: nft_set_hash: skip duplicated elements pending gc run")
	Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit 542ed81)
	Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant