In the Linux kernel, the following vulnerability has been resolved:
dm-bufio: fix sched in atomic context
If "tryverifyintasklet" is set for dm-verity, DMBUFIOCLIENTNOSLEEP is enabled for dm-bufio. However, when bufio tries to evict buffers, there is a chance to trigger scheduling in spinlock_bh, the following warning is hit:
BUG: sleeping function called from invalid context at drivers/md/dm-bufio.c:2745 inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 123, name: kworker/2:2 preemptcount: 201, expected: 0 RCU nest depth: 0, expected: 0 4 locks held by kworker/2:2/123: #0: ffff88800a2d1548 ((wqcompletion)dmbufiocache){....}-{0:0}, at: processonework+0xe46/0x1970 #1: ffffc90000d97d20 ((workcompletion)(&dmbufioreplacementwork)){....}-{0:0}, at: processonework+0x763/0x1970 #2: ffffffff8555b528 (dmbufioclientslock){....}-{3:3}, at: doglobalcleanup+0x1ce/0x710 #3: ffff88801d5820b8 (&c->spinlock){....}-{2:2}, at: doglobalcleanup+0x2a5/0x710 Preemption disabled at: [<0000000000000000>] 0x0 CPU: 2 UID: 0 PID: 123 Comm: kworker/2:2 Not tainted 6.16.0-rc3-g90548c634bd0 #305 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 Workqueue: dmbufiocache doglobalcleanup Call Trace: <TASK> dumpstacklvl+0x53/0x70 _mightresched+0x360/0x4e0 doglobalcleanup+0x2f5/0x710 processonework+0x7db/0x1970 workerthread+0x518/0xea0 kthread+0x359/0x690 retfromfork+0xf3/0x1b0 retfromforkasm+0x1a/0x30 </TASK>
That can be reproduced by:
veritysetup format --data-block-size=4096 --hash-block-size=4096 /dev/vda /dev/vdb SIZE=$(blockdev --getsz /dev/vda) dmsetup create myverity -r --table "0 $SIZE verity 1 /dev/vda /dev/vdb 4096 4096 <data_blocks> 1 sha256 <root_hash> <salt> 1 tryverifyintasklet" mount /dev/dm-0 /mnt -o ro echo 102400 > /sys/module/dmbufio/parameters/maxcachesize_bytes [read files in /mnt]
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1bf1a782fdf5c482215c0c661b5da98b8e75773",
"id": "CVE-2025-38496-29a92180",
"deprecated": false,
"target": {
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"323219390414068463283856188415384372011",
"338520252223923924316549919479739353767",
"308697858487507823246165643505724367339",
"34172731608695445085839923664826652440"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3edfdb1d4ef81320dae0caa40bc24baf8c1bbb86",
"id": "CVE-2025-38496-46f21cd9",
"deprecated": false,
"target": {
"function": "__evict_many",
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"length": 456.0,
"function_hash": "296064634259276918218819897656635767021"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3edfdb1d4ef81320dae0caa40bc24baf8c1bbb86",
"id": "CVE-2025-38496-8b4ad365",
"deprecated": false,
"target": {
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"280380512622805793174653291514634141422",
"338520252223923924316549919479739353767",
"67819458036856868796275595890864681251",
"205594104042950090543362174898669127239"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@469a39a33a9934af157299bf11c58f6e6cb53f85",
"id": "CVE-2025-38496-91efea41",
"deprecated": false,
"target": {
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"280380512622805793174653291514634141422",
"338520252223923924316549919479739353767",
"67819458036856868796275595890864681251",
"205594104042950090543362174898669127239"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@68860d1ade385eef9fcdbf6552f061283091fdb8",
"id": "CVE-2025-38496-cd4fde61",
"deprecated": false,
"target": {
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"280380512622805793174653291514634141422",
"338520252223923924316549919479739353767",
"67819458036856868796275595890864681251",
"205594104042950090543362174898669127239"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@469a39a33a9934af157299bf11c58f6e6cb53f85",
"id": "CVE-2025-38496-d424f390",
"deprecated": false,
"target": {
"function": "__evict_many",
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"length": 456.0,
"function_hash": "296064634259276918218819897656635767021"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@68860d1ade385eef9fcdbf6552f061283091fdb8",
"id": "CVE-2025-38496-f4eb6990",
"deprecated": false,
"target": {
"function": "__evict_many",
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"length": 456.0,
"function_hash": "296064634259276918218819897656635767021"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b1bf1a782fdf5c482215c0c661b5da98b8e75773",
"id": "CVE-2025-38496-fb1e8bc0",
"deprecated": false,
"target": {
"function": "__evict_a_few",
"file": "drivers/md/dm-bufio.c"
},
"signature_version": "v1",
"digest": {
"length": 571.0,
"function_hash": "313485541104238070570330075901431878872"
},
"signature_type": "Function"
}
]