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 CA37326C3BC for ; Sat, 4 Oct 2025 15:53:06 +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=1759593186; cv=none; b=P50cvAg8seHCV89QVlL+Y6153jwyeMLtXDiAlKgEH7DS23nySM69zZZ06Q208PXI88kligV1EsJ4Q+jHYeTYKYsv9RUMgcQ2sKHm5Q3V2b0KQPM0WcjDkuV7lyE/sMnjZSkCUoJ5OPp6dBdu/y2vEpcHArMUL5YrC9jTp9iMmYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759593186; c=relaxed/simple; bh=Zr5r0ZGLahEEy/aiUbsYlNdNe+YMUOVTI9WMAESAFxM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZChPR2Bg5zFHVofSoXZp3I+DmK0cHEbRO5PLeKdC4lJUeb4Bn/MEVx6oogoSCk/FoEFS8PwryU5SyRHRuwsLL+OmrHTFAv6y80b6P58Qht30Zt3bsMYl8HqBjK+UjE6/rHAtt34qfDFRi9twMYl6PnkQkBcoJ34SGZfE/FVzPdY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rdf9Fc4A; 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="Rdf9Fc4A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 549ABC4CEF1; Sat, 4 Oct 2025 15:53:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759593186; bh=Zr5r0ZGLahEEy/aiUbsYlNdNe+YMUOVTI9WMAESAFxM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Rdf9Fc4AkrlE3s9aYSsgFS7f834n7O8wG5FSuKudj6LGDlz6p8RAizhD81L6WJIfz hBXkejrAWF+mdpc6j7z7znaVM1b+OkaAqJMRp8fSTRv5XKoga8AITzbf7aESuV8/C8 S6SXxJ8tmPjZaERG+OB9b3kJ68NHFF7ODNv5DpJg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50506: drbd: only clone bio if we have a backing device Date: Sat, 4 Oct 2025 17:51:31 +0200 Message-ID: <2025100422-CVE-2022-50506-1642@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=2334; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9/QyHxdViSqkeucO4Vj7YeT6b5u+9JrdZN8LAfVfa6I=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPnaqcd56Nya2WrbovP2+Sv2z/fh+zM8bbqmwWm5ccs DzJ2eXTEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABN5Xsew4NLGXK05T2079+42 9t+7tzQl1rR9J8OC65673fZeO7nln/bHTWfXiNZetLj3AwA= 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: drbd: only clone bio if we have a backing device Commit c347a787e34cb (drbd: set ->bi_bdev in drbd_req_new) moved a bio_set_dev call (which has since been removed) to "earlier", from drbd_request_prepare to drbd_req_new. The problem is that this accesses device->ldev->backing_bdev, which is not NULL-checked at this point. When we don't have an ldev (i.e. when the DRBD device is diskless), this leads to a null pointer deref. So, only allocate the private_bio if we actually have a disk. This is also a small optimization, since we don't clone the bio to only to immediately free it again in the diskless case. The Linux kernel CVE team has assigned CVE-2022-50506 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit c347a787e34cba0e5a80a04082dacaf259105605 and fixed in 6.0.6 with commit 05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf Issue introduced in 5.18 with commit c347a787e34cba0e5a80a04082dacaf259105605 and fixed in 6.1 with commit 6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5 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-50506 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/drbd/drbd_req.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/05580a3bbf3cec677cb00a85dfeb21d6a9b48eaf https://git.kernel.org/stable/c/6d42ddf7f27b6723549ee6d4c8b1b418b59bf6b5