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 B3E7226B085 for ; Fri, 9 May 2025 05:57:55 +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=1746770275; cv=none; b=qGNg5C3edmV9yiG+VWI1cRQcGIq3h8te9zUFisWKAvg7Q+CEuJvAJrvr/+9dH5Ns8acGS31kvGh044nm7y9gffwbFctltbya59cUtjhHfwjXtAMYr7PmK4bAn3ZoP+8+L064w//J/hj5ZOHNJYr3VSQ8F+G48piML2SJuuriv68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746770275; c=relaxed/simple; bh=UCyIxUaUivYZUrNMGXWTcd+gmRWPpP4iUucdG9ZJ9j0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ea5qKu1adz38tE3MkQ/pTiULk32YW4OPWmrXrrmOH/iZEL9rDnrpNw5zj/NsItqEN2h0hNIS/5hL+0b5iEThIIYOtteSoon03qXE2x5nXAIIbNrQ0DSieizVpXak+KL/w5roMQYsh+ZtTvwUDy3SLxnGsabzD2iYhcMzKSMleCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SXBX70WI; 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="SXBX70WI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C688FC4CEE4; Fri, 9 May 2025 05:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746770275; bh=UCyIxUaUivYZUrNMGXWTcd+gmRWPpP4iUucdG9ZJ9j0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SXBX70WIOfw2wxagxPBRlvaaAUENYv89JrDfM+LtOqx3+giCX09yUvCOqYDSFGTxj p+WmWEGFx6zevwM/2czp4uq+zXwNgPIIz97JlhuNU5oppjRavhEmiltfjVc4cuJq4e 3k9HkRnWplwFnGwR9rIASiXrOKUWtV5UIjA9tsis= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-21546: scsi: target: Fix WRITE_SAME No Data Buffer crash Date: Fri, 9 May 2025 07:57:44 +0200 Message-ID: <2025050943-CVE-2022-21546-1ee8@gregkh> X-Mailer: git-send-email 2.49.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=2083; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=A1I9362jqHQqzgjzUcELRraMl2tHmIzNVqQEs9ej2PA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBmyM8MfhhswvTy7bsoq04qL5fdeeXzZvortcJu++Ga+Z Wauyp0NHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR5yMM87NPz3bexmzwo6k2 Pnqe7WVVVddQQYb5zrbyOXzNjWFZ162Strbt1Fd361kKAA== 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: scsi: target: Fix WRITE_SAME No Data Buffer crash In newer version of the SBC specs, we have a NDOB bit that indicates there is no data buffer that gets written out. If this bit is set using commands like "sg_write_same --ndob" we will crash in target_core_iblock/file's execute_write_same handlers when we go to access the se_cmd->t_data_sg because its NULL. This patch adds a check for the NDOB bit in the common WRITE SAME code because we don't support it. And, it adds a check for zero SG elements in each handler in case the initiator tries to send a normal WRITE SAME with no data buffer. The Linux kernel CVE team has assigned CVE-2022-21546 to this issue. Affected and fixed versions =========================== Fixed in 5.19 with commit ccd3f449052449a917a3e577d8ba0368f43b8f29 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-21546 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/target/target_core_file.c drivers/target/target_core_iblock.c drivers/target/target_core_sbc.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/ccd3f449052449a917a3e577d8ba0368f43b8f29