Skip to contentSkip to conversation

CVE-2025-68823: ublk: fix deadlock when reading partition table

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jan 13

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

ublk: fix deadlock when reading partition table

When one process(such as udev) opens ublk block device (e.g., to read the partition table via bdev_open()), a deadlock[1] can occur:

1. bdev_open() grabs disk->open_mutex
2. The process issues read I/O to ublk backend to read partition table
3. In __ublk_complete_rq(), blk_update_request() or blk_mq_end_request() runs bio->bi_end_io() callbacks
4. If this triggers fput() on file descriptor of ublk block device, the work may be deferred to current task's task work (see fput() implementation)
5. This eventually calls blkdev_release() from the same context
6. blkdev_release() tries to grab disk->open_mutex again
7. Deadlock: same task waiting for a mutex it already holds

The fix is to run blk_update_request() and blk_mq_end_request() with bottom halves disabled. This forces blkdev_release() to run in kernel work-queue context instead of current task work context, and allows ublk server to make forward progress, and avoids the deadlock.

[axboe: rewrite comment in ublk]

The Linux kernel CVE team has assigned CVE-2025-68823 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.0 with commit 71f28f3136aff5890cd56de78abc673f8393cad9 and fixed in 6.18.3 with commit 0460e09a614291f06c008443f47393c37b7358e7
	Issue introduced in 6.0 with commit 71f28f3136aff5890cd56de78abc673f8393cad9 and fixed in 6.19-rc2 with commit c258f5c4502c9667bccf5d76fa731ab9c96687c1

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-68823

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/block/ublk_drv.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/0460e09a614291f06c008443f47393c37b7358e7
	https://git.kernel.org/stable/c/c258f5c4502c9667bccf5d76fa731ab9c96687c1