CVE-2024-56693: brd: defer automatic disk creation until module initialization succeeds
In the Linux kernel, the following vulnerability has been resolved:
brd: defer automatic disk creation until module initialization succeeds
My colleague Wupeng found the following problems during fault injection:
BUG: unable to handle page fault for address: fffffbfff809d073
PGD 6e648067 P4D 123ec8067 PUD 123ec4067 PMD 100e38067 PTE 0
Oops: Oops: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 5 UID: 0 PID: 755 Comm: modprobe Not tainted 6.12.0-rc3+ #17
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
1.16.1-2.fc37 04/01/2014
RIP: 0010:__asan_load8+0x4c/0xa0
...
Call Trace:
<TASK>
blkdev_put_whole+0x41/0x70
bdev_release+0x1a3/0x250
blkdev_release+0x11/0x20
__fput+0x1d7/0x4a0
task_work_run+0xfc/0x180
syscall_exit_to_user_mode+0x1de/0x1f0
do_syscall_64+0x6b/0x170
entry_SYSCALL_64_after_hwframe+0x76/0x7e
loop_init() is calling loop_add() after __register_blkdev() succeeds and
is ignoring disk_add() failure from loop_add(), for loop_add() failure
is not fatal and successfully created disks are already visible to
bdev_open().
brd_init() is currently calling brd_alloc() before __register_blkdev()
succeeds and is releasing successfully created disks when brd_init()
returns an error. This can cause UAF for the latter two case:
case 1:
T1:
modprobe brd
brd_init
brd_alloc(0) // success
add_disk
disk_scan_partitions
bdev_file_open_by_dev // alloc file
fput // won't free until back to userspace
brd_alloc(1) // failed since mem alloc error inject
// error path for modprobe will release code segment
// back to userspace
__fput
blkdev_release
bdev_release
blkdev_put_whole
bdev->bd_disk->fops->release // fops is freed now, UAF!
case 2:
T1: T2:
modprobe brd
brd_init
brd_alloc(0) // success
open(/dev/ram0)
brd_alloc(1) // fail
// error path for modprobe
close(/dev/ram0)
...
/* UAF! */
bdev->bd_disk->fops->release
Fix this problem by following what loop_init() does. Besides,
reintroduce brd_devices_mutex to help serialize modifications to
brd_list.
Security readout for executives and security teams
Plain-English summary
A Linux RAM-disk driver initialization failure can leave references pointing to released driver code or structures. A local attacker reaching this condition may trigger a use-after-free with potentially severe confidentiality, integrity, and availability impact. The supplied sources do not show active exploitation.
Executive priority
Treat this as a high-priority kernel update, especially where low-privileged local code can run or brd RAM disks are available. It is not supported as an emergency remote-exploitation event: potential host impact is severe, but the attack vector is local and exploitation remains unconfirmed.
Technical view
CWE-416 occurs in brd_init because RAM disks become visible before registration and module initialization fully succeed. If later initialization fails, cleanup can free disks or module code while deferred file release or another thread closes a RAM-disk device and dereferences freed operations. The fix defers disk creation and restores mutex serialization.
Likely exposure
Exposure concerns Linux systems containing the vulnerable brd implementation where the RAM-disk driver can be initialized. The bundle provides version values spanning 5.14 through 6.13, but its flattened list does not reliably establish every fixed boundary. Distribution backports may change status, so validate the exact running build against vendor advisories and referenced commits.
Exploitation context
The bundle marks KEV false and provides no evidence of active exploitation or public weaponization. The supplied CVSS vector indicates local access with low privileges. Triggering also involves failed brd initialization and an outstanding or concurrent RAM-disk reference; these sources do not support an unauthenticated remote attack scenario.
Researcher notes
The issue was reproduced under fault injection with KASAN. Documented cases involve deferred file release after failed module initialization and concurrent open or close activity on a RAM-disk device. Sources establish a plausible kernel use-after-free and stable fixes, but not reliable privilege escalation, complete distribution package mappings, or exploitation in the wild.
Mitigation direction
Obtain a corrected kernel from your Linux distributor or use a build containing the applicable referenced stable fix.
Test, deploy, and reboot into the corrected kernel according to established change-management procedures.
If rollout is delayed, consult distributor guidance for supported temporary mitigations; none are specified in this bundle.
Validation and detection
Inventory the exact running kernel and vendor package release across Linux assets.
Compare each build with distributor advisories and referenced stable commits, accounting for backports.
Determine whether brd is built in, loadable, loaded, or required by workloads.
After remediation, confirm the corrected kernel is running and review logs for related Oops or KASAN reports.
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.
cwe · low confidence lookup
CWE-416: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
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.
2CVSS vectors
3Timeline events
2ADP providers
8Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: noneAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-416 · source CWE mapping
Use After Free
Use After Free represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.