Executive brief
A vulnerability was identified in the Linux kernel's networking subsystem (netfilter) that could allow a local user to cause system instability or potentially gain unauthorized privileges. The issue stems from a technical conflict when the system tries to look up and remove firewall rules simultaneously. This could lead to a system crash or allow an attacker to interfere with the kernel's memory.
Technical details
A race condition exists in the nf_tables component of the Linux kernel due to improper synchronization in the __nft_expr_type_get() function. Specifically, nft_unregister_expr() can run concurrently with __nft_expr_type_get() while it iterates over the nf_tables_expressions list without adequate RCU protection. This lack of locking during list iteration can lead to a data race. An attacker with local access could exploit this timing window to cause a kernel panic (DoS) or achieve arbitrary code execution in kernel mode. The fix involves implementing list_for_each_entry_rcu() and appropriate rcu_read_lock() calls to ensure thread-safe access to the expression list.
Affected products
- Linux Linux Kernel 3.13 to 4.19.313, 4.20 to 5.4.275, 5.5 to 5.10.216, 5.11 to 5.15.157, 5.16 to 6.1.88, 6.2 to 6.6.29, 6.7 to 6.8.8
Timeline
- 2024-04-07: other: Patch authored
- 2024-04-27: patched: Fix committed to stable trees
- 2024-05-01: disclosed: CVE published
References
- https://git.kernel.org/stable/c/01f1a678b05ade4b1248019c2dcca773aebbeb7f
- https://git.kernel.org/stable/c/0b6de00206adbbfc6373b3ae38d2a6f197987907
- https://git.kernel.org/stable/c/8d56bad42ac4c43c6c72ddd6a654a2628bf839c5
- https://git.kernel.org/stable/c/934e66e231cff2b18faa2c8aad0b8cec13957e05
- https://git.kernel.org/stable/c/939109c0a8e2a006a6cc8209e262d25065f4403a
- https://git.kernel.org/stable/c/a9ebf340d123ae12582210407f879d6a5a1bc25b
- https://git.kernel.org/stable/c/b38a133d37fa421c8447b383d788c9cc6f5cb34c