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 8527E2D73A1 for ; Tue, 7 Oct 2025 15:20:18 +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=1759850418; cv=none; b=XoxNQSSWzCklywBLqbEQOvWvC2PSB94zolPS/yKwo7N4tmn7GtWqxGkGRc30AHSrBEMZDz7AAexip/cajlTmkd7t1C5i3nuhhgCfWKIhywNgdrxFQaow+p/Cd+iuzHR8wQp1oswsKPJzELfEEZ3Zwrv3XZN1zvSjRi2aDzm9m0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850418; c=relaxed/simple; bh=i8XmElTRHs0eQQySFbrurw8QAk5F1ODprPEnvM4h5y8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hvZcZL2CNyunaHy6iq9q9ptUoYeNyudeYWYCRhV7Nd8pVQuAMd0tzZ7EQngpxpzWRA1uTO6AiBs1BS5A8izb1HqNGljd2LxK+KEJYGAT3jzSKljtXmuj2KskDAXPdsrseICUV7vvH5CdSdzrV8WQEr6kNt2XxW4flqA4C3NKT7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JEjed/W1; 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="JEjed/W1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05837C4CEF1; Tue, 7 Oct 2025 15:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850418; bh=i8XmElTRHs0eQQySFbrurw8QAk5F1ODprPEnvM4h5y8=; h=From:To:Cc:Subject:Date:Reply-to:From; b=JEjed/W19za/LQDTLrREotkyv6DEAkNG5Yz1GQiVXAEYrcRrGJG1UyfzX/7altGsR brDCtbJ8cNBxdmcHrp4PRDH0vyWP6BZG6E+U1k/FkcEsf1nDAT8lZk5mUgL1T7+4pT UAZ6DGQD6qDaUSTqf+J7of0tZDmG9NHmbKPmvEHI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50530: blk-mq: fix null pointer dereference in blk_mq_clear_rq_mapping() Date: Tue, 7 Oct 2025 17:19:17 +0200 Message-ID: <2025100707-CVE-2022-50530-ef6b@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=2610; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0tXCl01TX+wHOVEUEXAWqB9eUSAvdzW8k8+QH4S8RUs=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9bO77hW5rrwg/f9TZ1GLuLY3b0zvcwdd+ZbVR0Od1 k6MPmDSEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPxW8CwYE/p2vt2CwKrcsuK c8s0Lv7lvfnEnWFB43Wmjcksgtut+XceqV7A9nSxT80lAA== 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: fix null pointer dereference in blk_mq_clear_rq_mapping() Our syzkaller report a null pointer dereference, root cause is following: __blk_mq_alloc_map_and_rqs set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs blk_mq_alloc_map_and_rqs blk_mq_alloc_rqs // failed due to oom alloc_pages_node // set->tags[hctx_idx] is still NULL blk_mq_free_rqs drv_tags = set->tags[hctx_idx]; // null pointer dereference is triggered blk_mq_clear_rq_mapping(drv_tags, ...) This is because commit 63064be150e4 ("blk-mq: Add blk_mq_alloc_map_and_rqs()") merged the two steps: 1) set->tags[hctx_idx] = blk_mq_alloc_rq_map() 2) blk_mq_alloc_rqs(..., set->tags[hctx_idx]) into one step: set->tags[hctx_idx] = blk_mq_alloc_map_and_rqs() Since tags is not initialized yet in this case, fix the problem by checking if tags is NULL pointer in blk_mq_clear_rq_mapping(). The Linux kernel CVE team has assigned CVE-2022-50530 to this issue. Affected and fixed versions =========================== Issue introduced in 5.16 with commit 63064be150e4b1ba1e4af594ef5aa81adf21a52d and fixed in 6.0.6 with commit 6a440e6d04431e774dc084abe88c106e2a474c1a Issue introduced in 5.16 with commit 63064be150e4b1ba1e4af594ef5aa81adf21a52d and fixed in 6.1 with commit 76dd298094f484c6250ebd076fa53287477b2328 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-50530 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 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/6a440e6d04431e774dc084abe88c106e2a474c1a https://git.kernel.org/stable/c/76dd298094f484c6250ebd076fa53287477b2328