CVE-2024-42109: netfilter: nf_tables: unconditionally flush pending work before notifier
In the Linux kernel, the following vulnerability has been resolved:
netfilter: nftables: unconditionally flush pending work before notifier
syzbot reports:
KASAN: slab-uaf in nftctxupdate include/net/netfilter/nftables.h:1831 KASAN: slab-uaf in nftcommitrelease net/netfilter/nftablesapi.c:9530 KASAN: slab-uaf int nftablestransdestroywork+0x152b/0x1750 net/netfilter/nftablesapi.c:9597 Read of size 2 at addr ffff88802b0051c4 by task kworker/1:1/45 [..] Workqueue: events nftablestransdestroywork Call Trace: nftctxupdate include/net/netfilter/nftables.h:1831 [inline] nftcommitrelease net/netfilter/nftablesapi.c:9530 [inline] nftablestransdestroywork+0x152b/0x1750 net/netfilter/nftablesapi.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 flushwork 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 e169285f8c56 ("netfilter: nftables: do not store nftctx in transaction objects"), with this commit applied there is an unconditional fetch of table->family which is whats triggering the above splat.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-42109?
CVE-2024-42109 is classified with a high severity level due to its potential impact on system integrity.
How do I fix CVE-2024-42109?
To resolve CVE-2024-42109, update your Linux kernel to a version that includes the fix, such as 5.10.223-1 or 6.1.123-1.
What systems are affected by CVE-2024-42109?
CVE-2024-42109 affects various Linux kernel versions, particularly between 5.15.129 to 5.15.163 and 6.1.50 to 6.1.98.
Is there a specific patch for CVE-2024-42109?
Yes, the fix for CVE-2024-42109 has been included in several kernel updates; please ensure you are running one of the remedied versions.
What type of vulnerability is CVE-2024-42109?
CVE-2024-42109 is a use-after-free vulnerability identified in the netfilter component of the Linux kernel.