CVE-2026-142922: sysctl: unregister tables before freeing bitmap
In the Linux kernel, the following vulnerability has been resolved:
sysctl: unregister tables before freeing bitmap
The table registered for bitmap0001 retains a pointer to testdata.bitmap0001. unregistersysctltable() prevents new handlers from starting and waits for active handlers to finish.
testsysctlexit() currently frees the bitmap before unregistering the table. A concurrent read during module removal can therefore enter procdolargebitmap() while the bitmap is freed. KASAN reports a slab-use-after-free in findnextbit().
Unregister all tables before freeing the bitmap so the unregister rundown provides the required lifetime boundary.
The unmodified module reproduced the use-after-free in three KASAN runs. With this change, three runs each completed 100 load, read and unload race rounds without a kernel diagnostic.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.120 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.65 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.6 - Compensating control
In test_sysctl_exit(), unregister all sysctl tables before freeing the bitmap. unregister_sysctl_table() prevents new handlers from starting and waits for active handlers to finish.
Event History
Frequently Asked Questions
What conditions are required to trigger the issue?
A concurrent read of the sysctl bitmap entry must race with removal of the module that owns the bitmap. The read can enter proc_do_large_bitmap() after the bitmap has been freed but before its sysctl table is unregistered.
Which systems are realistically exposed?
Systems are exposed when the affected sysctl test module is loaded and its bitmap sysctl entry can be read while the module is being unloaded. The provided information does not establish whether this module is enabled or loaded by default.
What can be done if the fix cannot be applied immediately?
Avoid unloading the affected module while reads of its sysctl entries may be in progress. Preventing concurrent access to the bitmap sysctl entry during module removal removes the race condition described.
How can administrators identify a suspected occurrence?
On KASAN-enabled kernels, the unmodified module produced a slab use-after-free diagnostic in _find_next_bit(). The issue was reproduced by racing module load, bitmap reads, and unload operations.