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 26BBC2E5B0C for ; Tue, 7 Oct 2025 15:24:16 +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=1759850656; cv=none; b=LW+ptk2P8CEtNgVqP6xjQubZ2jHbue6S8RApXP4ZLFYExiFxcH6QKzrOlJTRvadTgY2Hz0Rlv0zaUJ0WwCzQFdPSZFbjZ941vOorqdhoZQCzgMJe6FaxAq5EJwR5uotGTER59qixVVXqJfVSB8PCsmHTLJQxC0F+7M4rYZVJA4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850656; c=relaxed/simple; bh=D4BCnhMhgZslVb5YmP8fonBCCnvl4UsVJbt1JM1m3XU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ra8lNfPITgU+zl5m5BRuAbc5udNGwtWpGldI/mAal/uqw/F+im2ncAYqwtnPsFbWtunP8RPtRFqGixJ01cCZfaVAame4Uhu4cUQ4NftW9g9fBzuyXfOxl9PPXQ90PSaRevdfnVuvz3K2r5XhC5y3ena6ip2h7U0JFsgfcHgc0Ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=OjOAdAXy; 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="OjOAdAXy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1D54C4CEF1; Tue, 7 Oct 2025 15:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850656; bh=D4BCnhMhgZslVb5YmP8fonBCCnvl4UsVJbt1JM1m3XU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=OjOAdAXyPSOYaZb72wUNIpPZizVcGPVYuwXJjBLTmirpvxW3N9tFFCeQJ9IjP3Vvf DrKOOTQJQWNTnYL2LvUHW/AU22YRkyu8SpGLtbs9kBE++aMVUzE/jYIgtM+tYtQlFX G89p36ikAUxUsNVMiSTMIqhA01jebl/Astu48XNA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50552: blk-mq: use quiesced elevator switch when reinitializing queues Date: Tue, 7 Oct 2025 17:21:10 +0200 Message-ID: <2025100759-CVE-2022-50552-5100@gregkh> X-Mailer: git-send-email 2.51.0 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=2933; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=YWEwD+B+oYlK2qGNs0/xjxGXueZwHy0L2HVRMgpCbH4=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9W9P+FFps8o9QaR3UdaiHZbckez/0xR3FhdpnDyj0 6uStJGtI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaScZZhfnms3PPauTM/q7NK XLkY/31tcPSOMoYFx+RkvkTO8ol1vnEt6urJzDNrP5xOBQA= 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: blk-mq: use quiesced elevator switch when reinitializing queues The hctx's run_work may be racing with the elevator switch when reinitializing hardware queues. The queue is merely frozen in this context, but that only prevents requests from allocating and doesn't stop the hctx work from running. The work may get an elevator pointer that's being torn down, and can result in use-after-free errors and kernel panics (example below). Use the quiesced elevator switch instead, and make the previous one static since it is now only used locally. nvme nvme0: resetting controller nvme nvme0: 32/0/0 default/read/poll queues BUG: kernel NULL pointer dereference, address: 0000000000000008 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 80000020c8861067 P4D 80000020c8861067 PUD 250f8c8067 PMD 0 Oops: 0000 [#1] SMP PTI Workqueue: kblockd blk_mq_run_work_fn RIP: 0010:kyber_has_work+0x29/0x70 ... Call Trace: __blk_mq_do_dispatch_sched+0x83/0x2b0 __blk_mq_sched_dispatch_requests+0x12e/0x170 blk_mq_sched_dispatch_requests+0x30/0x60 __blk_mq_run_hw_queue+0x2b/0x50 process_one_work+0x1ef/0x380 worker_thread+0x2d/0x3e0 The Linux kernel CVE team has assigned CVE-2022-50552 to this issue. Affected and fixed versions =========================== Fixed in 5.19.17 with commit 63a681bcc32a43528ce0f690569f7f48e59c3963 Fixed in 6.0.3 with commit c478b3b2900f1834cf9eda5bfef0d5696099505d Fixed in 6.1 with commit 8237c01f1696bc53c470493bf1fe092a107648a6 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-2022-50552 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: block/blk-mq.c block/blk.h block/elevator.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/63a681bcc32a43528ce0f690569f7f48e59c3963 https://git.kernel.org/stable/c/c478b3b2900f1834cf9eda5bfef0d5696099505d https://git.kernel.org/stable/c/8237c01f1696bc53c470493bf1fe092a107648a6