CVE-2023-52468: class: fix use-after-free in class_register()
In the Linux kernel, the following vulnerability has been resolved:
class: fix use-after-free in class_register()
The lock_class_key is still registered and can be found in
lock_keys_hash hlist after subsys_private is freed in error
handler path.A task who iterate over the lock_keys_hash
later may cause use-after-free.So fix that up and unregister
the lock_class_key before kfree(cp).
On our platform, a driver fails to kset_register because of
creating duplicate filename '/class/xxx'.With Kasan enabled,
it prints a invalid-access bug report.
KASAN bug report:
BUG: KASAN: invalid-access in lockdep_register_key+0x19c/0x1bc
Write of size 8 at addr 15ffff808b8c0368 by task modprobe/252
Pointer tag: [15], memory tag: [fe]
CPU: 7 PID: 252 Comm: modprobe Tainted: G W
6.6.0-mainline-maybe-dirty #1
Call trace:
dump_backtrace+0x1b0/0x1e4
show_stack+0x2c/0x40
dump_stack_lvl+0xac/0xe0
print_report+0x18c/0x4d8
kasan_report+0xe8/0x148
__hwasan_store8_noabort+0x88/0x98
lockdep_register_key+0x19c/0x1bc
class_register+0x94/0x1ec
init_module+0xbc/0xf48 [rfkill]
do_one_initcall+0x17c/0x72c
do_init_module+0x19c/0x3f8
...
Memory state around the buggy address:
ffffff808b8c0100: 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a 8a
ffffff808b8c0200: 8a 8a 8a 8a 8a 8a 8a 8a fe fe fe fe fe fe fe fe
>ffffff808b8c0300: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe
^
ffffff808b8c0400: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
As CONFIG_KASAN_GENERIC is not set, Kasan reports invalid-access
not use-after-free here.In this case, modprobe is manipulating
the corrupted lock_keys_hash hlish where lock_class_key is already
freed before.
It's worth noting that this only can happen if lockdep is enabled,
which is not true for normal system.
Security readout for executives and security teams
Plain-English summary
A Linux kernel class registration error path can leave a freed lockdep key registered. Later lockdep activity can touch freed memory and crash or corrupt kernel state. The report says this only occurs when lockdep is enabled, which is not typical for normal production systems.
Executive priority
Treat this as low urgency for typical production fleets, but patch through normal kernel maintenance. Raise priority for debugging, lab, appliance, or custom-kernel environments where lockdep is enabled or third-party drivers are frequently loaded.
Technical view
class_register() could free subsys_private after kset_register failure while its lock_class_key remained in lock_keys_hash. Later iteration or registration could hit stale memory. The upstream fix unregisters the lock_class_key before kfree(cp). The triggering example was duplicate /class/xxx creation during module load with KASAN reporting invalid access.
Likely exposure
Exposure appears limited to Linux kernels with lockdep enabled and a class_register() failure path, such as duplicate class names during driver or module registration. Normal production systems are likely less exposed because the source notes lockdep is not normally enabled.
Exploitation context
No source in the bundle reports active exploitation, and the CVE is not marked KEV. The available evidence describes a kernel debugging configuration issue observed through KASAN during module load, not a public exploitation path.
Researcher notes
The key constraint is lockdep. The CVE text explicitly says normal systems usually do not enable it. Affected version data in the bundle is sparse, so rely on vendor advisories and the three stable commits for precise patch mapping.
Mitigation direction
Prioritize vendor kernel updates that include the referenced stable commits.
Check distribution advisories for backported fixes matching CVE-2023-52468.
Avoid enabling lockdep on production kernels unless operationally required.
Review custom drivers for duplicate class registration behavior.
Validation and detection
Inventory Linux kernel versions and distribution patch levels.
Confirm whether production kernels are built with lockdep enabled.
Check vendor changelogs for the referenced class_register() fix.
Review crash logs for KASAN or lockdep reports around class_register().
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2023-52468 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.