Skip to contentSkip to conversation

CVE-2023-53111: loop: Fix use-after-free issues

DISCUSSION Greg Kroah-Hartman 1 participant 1 message May 2, 2025

lore
Share & tools
lore
#0 lore raw

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

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

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

loop: Fix use-after-free issues

do_req_filebacked() calls blk_mq_complete_request() synchronously or asynchronously when using asynchronous I/O unless memory allocation fails. Hence, modify loop_handle_cmd() such that it does not dereference 'cmd' nor 'rq' after do_req_filebacked() finished unless we are sure that the request has not yet been completed. This patch fixes the following kernel crash:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000054
Call trace:
 css_put.42938+0x1c/0x1ac
 loop_process_work+0xc8c/0xfd4
 loop_rootcg_workfn+0x24/0x34
 process_one_work+0x244/0x558
 worker_thread+0x400/0x8fc
 kthread+0x16c/0x1e0
 ret_from_fork+0x10/0x20

The Linux kernel CVE team has assigned CVE-2023-53111 to this issue.

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

	Issue introduced in 4.4 with commit bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6 and fixed in 5.15.104 with commit 407badf73ec9fb0d5744bf2ca1745c1818aa222f
	Issue introduced in 4.4 with commit bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6 and fixed in 6.1.21 with commit e3fda704903f6d1fc351412f1bc6620333959ada
	Issue introduced in 4.4 with commit bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6 and fixed in 6.2.8 with commit 6917395c4667cfb607ed8bf1826205a59414657c
	Issue introduced in 4.4 with commit bc07c10a3603a5ab3ef01ba42b3d41f9ac63d1b6 and fixed in 6.3 with commit 9b0cb770f5d7b1ff40bea7ca385438ee94570eec

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-2023-53111

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/loop.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/407badf73ec9fb0d5744bf2ca1745c1818aa222f
	https://git.kernel.org/stable/c/e3fda704903f6d1fc351412f1bc6620333959ada
	https://git.kernel.org/stable/c/6917395c4667cfb607ed8bf1826205a59414657c
	https://git.kernel.org/stable/c/9b0cb770f5d7b1ff40bea7ca385438ee94570eec