AZL-117676: CVE-2026-142796 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
mm/slab: sample slabstate once in kmemcachedestroy()
kmemcacherelease() tests slabstate >= FULL after kmemcachedestroy() has dropped slabmutex and unlinked the cache, and for a SLABTYPESAFEBYRCU cache after rcubarrier(). If slablateinit() runs before that test it sets slabstate to FULL but skips the unlinked cache, which never got a sysfs entry, so sysfsslabrelease() calls kobjectput() on a kobject that was never initialized:
WARNING: lib/kobject.c:734 at kobjectput+0x64/0x2c0, CPU#1: kworker/u8:3/55 kobject: '(null)' ((ptrval)): is not initialized, yet kobjectput() is being called. refcountt: underflow; use-after-free. kobjectput+0x64/0x2c0 sysfsslabrelease+0xc/0x20 kmemcachedestroy+0x104/0x1e0 biosetexit+0x13c/0x1e0 diskrelease+0x54/0x140 putdisk+0x18/0x40 floppyasyncinit+0xbec/0xd10
slabstate >= FULL asks whether the cache has a kobject, which cache creation skips while slabstate <= UP. UP is the state just below FULL, so a false sample cannot skip a kobjectput() that was owed.
Seen on sparc64 at boot, where the asynchronous floppy init tears down its bio slab while the late initcalls are running.
Sample slabstate once, under slabmutex which slablateinit() holds when it sets FULL, and use the result for both the unlink and the release.
The history of this problem dates back to v3.2:
Commit 69cb8e6b7c29 ("slub: free slabs without holding locks") in v3.2 moved sysfsslabremove() outside slublock and introduced a race condition between kmemcachedestroy() and slabsysfsinit().
Commit 945cf2b6199be ("mm/sl[aou]b: Extract a common function for kmemcachedestroy") in v3.7 accidentally closed the race while extracting a common implementation for kmemcachedestroy().
Commit 5413dfba88d6 ("slub: drop mutex before deleting sysfs entry") in v3.8 re-opened the race by dropping slabmutex around sysfsslabremove() in kmemcacheshutdown(), to avoid a lockdep splat between slabmutex and the sysfs lock.
Commit 657dc2f97220 ("slab: remove synchronous rcubarrier() call in memcg cache release path") in v4.11 shifted from synchronous rcubarrier() to asynchronous RCU work for SLABTYPESAFEBYRCU caches. That commit, again, accidentally closed the race by moving sysfsslabrelease() to shutdowncache(), but only for !SLABTYPESAFEBYRCU caches because destruction of SLABTYPESAFEBYRCU caches is done in an RCU work.
Commit 0495e337b703 ("mm/slabcommon: Deleting kobject in kmemcachedestroy() without holding slabmutex/cpuhotpluglock") in v6.0 re-introduced the race for !SLABTYPESAFEBYRCU caches.
Affected Software
Event History
Frequently Asked Questions
What runtime conditions trigger the issue?
The race occurs when kmem_cache_destroy() unlinks a cache and later checks slab_state while slab_late_init() changes slab_state to FULL. A cache created while slab_state was at or below UP may not have a sysfs kobject, but the later FULL-state check can still lead to kobject_put() being called on an uninitialized object.
How can I tell whether a system has encountered this problem?
Kernel logs may show a warning from lib/kobject.c at kobject_put() stating that a kobject is not initialized but kobject_put() is being called. The report also identifies refcount underflow and use-after-free symptoms, with stack frames including kobject_put(), sysfs_slab_release(), and kmem_cache_destroy().
Where has this been observed?
The issue was seen during boot on sparc64, where asynchronous floppy initialization tore down its bio slab while slab initialization was still progressing. The supplied data does not identify other confirmed affected architectures or workloads.