CVE-2024-50212: lib: alloc_tag_module_unload must wait for pending kfree_rcu calls
In the Linux kernel, the following vulnerability has been resolved:
lib: alloctagmoduleunload must wait for pending kfreercu calls
Ben Greear reports following splat: ------------[ cut here ]------------ net/netfilter/nfnatcore.c:1114 module nfnat func:nfnatregisterfn has 256 allocated at module unload WARNING: CPU: 1 PID: 10421 at lib/alloctag.c:168 alloctagmoduleunload+0x22b/0x3f0 Modules linked in: nfnat(-) btrfs ufs qnx4 hfsplus hfs minix vfat msdos fat ... Hardware name: Default string Default string/SKYBAY, BIOS 5.12 08/04/2020 RIP: 0010:alloctagmoduleunload+0x22b/0x3f0 codetagunloadmodule+0x19b/0x2a0 ? codetagloadmodule+0x80/0x80
nfnat module exit calls kfreercu on those addresses, but the free operation is likely still pending by the time alloctag checks for leaks.
Wait for outstanding kfreercu operations to complete before checking resolves this warning.
Reproducer: unshare -n iptables-nft -t nat -A PREROUTING -p tcp grep nfnat /proc/allocinfo # will list 4 allocations rmmod nftchainnat rmmod nfnat # will WARN.
[akpm@linux-foundation.org: add comment]
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-50212?
CVE-2024-50212 has been classified with a medium severity level.
How do I fix CVE-2024-50212?
To fix CVE-2024-50212, update to a patched version of the Linux kernel as specified in the advisory.
What systems are affected by CVE-2024-50212?
CVE-2024-50212 affects various versions of the Linux kernel, particularly those prior to the fixed releases.
What is the nature of CVE-2024-50212?
CVE-2024-50212 involves a race condition related to the allocation and unloading of kernel modules.
Who reported the CVE-2024-50212 vulnerability?
The vulnerability CVE-2024-50212 was reported by Ben Greear.