Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 885511DB125 for ; Mon, 28 Jul 2025 11:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753701808; cv=none; b=onMKm8bYtVdBwzOgkEYZdSdj2TRI/kl7S9J7hIq8IE7aeGBfx1JqHwnuyFpYs0Z+jcW6EJgnuVsfC99ZEvTg24rKvY0jU8JwdNfg99AXV7Gl6+zugtBvqg/duqubvsLYWxpOeNUa/xjp1rozkQ3z9QVgDtIz485bAQpe4zL4s+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753701808; c=relaxed/simple; bh=A4zhov+kNJFkshPNtRDSZB9kDNGaEeuDTd6NpqLJrk0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oqGcE5t0nAPTjHZJ1gXrZNbg/s0IccV/AbH0sppIDjIN8Ve+H9E2LonIcH8Mg5hQg3yQGG/bQ70yisjTmVhrlU4wgWHDbIhTbhVPC17y0C4WdTc6jeHvNBtiJhE5L7k8rR3wT8t1hYn+g4GhWkS9iRCRXx76XvvnD4Evlg+i3ow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qmaGcTMl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qmaGcTMl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94359C4CEF7; Mon, 28 Jul 2025 11:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753701808; bh=A4zhov+kNJFkshPNtRDSZB9kDNGaEeuDTd6NpqLJrk0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=qmaGcTMlrE/TN+3O9A5fmRsyatkdKwVM+o32o13KVbUdpOk8z7Xzo7c7+b92M53pI yyg4fRQ6i3eOePCufz7hshuG2J3S1qF25w18v0FS9EEnaygUhspFuAm9VTGa5+aJV+ 1CapirdiFJY+NkgusJMEvJHpJKlar1LH/we6Dw9s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38496: dm-bufio: fix sched in atomic context Date: Mon, 28 Jul 2025 13:22:38 +0200 Message-ID: <2025072818-CVE-2025-38496-4301@gregkh> X-Mailer: git-send-email 2.50.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4095; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=jZRfe4LULCSWF2ypNmWeMEPoJge2GiUtTM5y32TVrVM=; b=owGbwMvMwCRo6H6F97bub03G02pJDBntsVkmvME/r7KZb5EQWul09WPDAY7IzU6/LM+c7b2nv Ff191vHjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIixzDHF5BFY+jk75zSFTN qDC2WnBP/ojxX4YFpy5ldF1vtFWPzc+sz902UeTP59w9AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: dm-bufio: fix sched in atomic context If "try_verify_in_tasklet" is set for dm-verity, DM_BUFIO_CLIENT_NO_SLEEP is enabled for dm-bufio. However, when bufio tries to evict buffers, there is a chance to trigger scheduling in spin_lock_bh, the following warning is hit: BUG: sleeping function called from invalid context at drivers/md/dm-bufio.c:2745 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 123, name: kworker/2:2 preempt_count: 201, expected: 0 RCU nest depth: 0, expected: 0 4 locks held by kworker/2:2/123: #0: ffff88800a2d1548 ((wq_completion)dm_bufio_cache){....}-{0:0}, at: process_one_work+0xe46/0x1970 #1: ffffc90000d97d20 ((work_completion)(&dm_bufio_replacement_work)){....}-{0:0}, at: process_one_work+0x763/0x1970 #2: ffffffff8555b528 (dm_bufio_clients_lock){....}-{3:3}, at: do_global_cleanup+0x1ce/0x710 #3: ffff88801d5820b8 (&c->spinlock){....}-{2:2}, at: do_global_cleanup+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: dm_bufio_cache do_global_cleanup Call Trace: dump_stack_lvl+0x53/0x70 __might_resched+0x360/0x4e0 do_global_cleanup+0x2f5/0x710 process_one_work+0x7db/0x1970 worker_thread+0x518/0xea0 kthread+0x359/0x690 ret_from_fork+0xf3/0x1b0 ret_from_fork_asm+0x1a/0x30 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 1 sha256 1 try_verify_in_tasklet" mount /dev/dm-0 /mnt -o ro echo 102400 > /sys/module/dm_bufio/parameters/max_cache_size_bytes [read files in /mnt] The Linux kernel CVE team has assigned CVE-2025-38496 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 450e8dee51aa6fa1dd0f64073e88235f1a77b035 and fixed in 6.6.100 with commit 469a39a33a9934af157299bf11c58f6e6cb53f85 Issue introduced in 6.4 with commit 450e8dee51aa6fa1dd0f64073e88235f1a77b035 and fixed in 6.12.40 with commit 68860d1ade385eef9fcdbf6552f061283091fdb8 Issue introduced in 6.4 with commit 450e8dee51aa6fa1dd0f64073e88235f1a77b035 and fixed in 6.15.8 with commit 3edfdb1d4ef81320dae0caa40bc24baf8c1bbb86 Issue introduced in 6.4 with commit 450e8dee51aa6fa1dd0f64073e88235f1a77b035 and fixed in 6.16 with commit b1bf1a782fdf5c482215c0c661b5da98b8e75773 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-38496 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: drivers/md/dm-bufio.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/469a39a33a9934af157299bf11c58f6e6cb53f85 https://git.kernel.org/stable/c/68860d1ade385eef9fcdbf6552f061283091fdb8 https://git.kernel.org/stable/c/3edfdb1d4ef81320dae0caa40bc24baf8c1bbb86 https://git.kernel.org/stable/c/b1bf1a782fdf5c482215c0c661b5da98b8e75773