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 689AEC2ED for ; Thu, 7 Nov 2024 09:35:34 +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=1730972135; cv=none; b=CfC8kl5LXzRVDTpBlhyYbnOJPYxzAqdPEETuujDgAV0ZcvQf0Mk01TXGTMRo2v+fBWsFj+1i1xQWdhebJ1Hpq154tduj0Wg3CSLd9c8wflqthvSXC8WsfHxWAxTj15QlWkTDsOEkNsBT9jLDJExIIPvHK9fenPeD8UvvjEFjB9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730972135; c=relaxed/simple; bh=PsO5pTJ5rmZYZJomxGH9/+dpFvFeC2VEIrnbmqTeN5Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=LEfcOkbHvmBpvxSpJIFSEaVS/vdK11GDumbrC+EaZepcMv+4W1OvMtZP37mHmV5h+TqEFFVNC9T0NUuamgxb8QFJLsGlUpUzjrPVNzF5YITvzOCTi5myXMwMLbdNsoCiputS0YPGDEY/U+GlyuUedYdizeTBIQ9j/vicccLBHLE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XQax5rSL; 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="XQax5rSL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57985C4CECC; Thu, 7 Nov 2024 09:35:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730972134; bh=PsO5pTJ5rmZYZJomxGH9/+dpFvFeC2VEIrnbmqTeN5Y=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XQax5rSLmXzQC2/BN3POaYmt+I8f5JqYwMu++wfR4D6u1seBdnz8bp4Dh9f6vFSP5 MxLe/00y39F5me9XJFomRXcMk4SXIQJJXH3nFtJ5wDJpYwng8vR/Wws8l/cRSWT0Xe aNG7VPkBC9Fndu/RFSqqMPnDaePWYZ+QH412Ql5s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50153: scsi: target: core: Fix null-ptr-deref in target_alloc_device() Date: Thu, 7 Nov 2024 10:34:53 +0100 Message-ID: <2024110745-CVE-2024-50153-ecf2@gregkh> X-Mailer: git-send-email 2.47.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=2966; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=PsO5pTJ5rmZYZJomxGH9/+dpFvFeC2VEIrnbmqTeN5Y=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk6nVt1Dm/YtLxi/cybR3o9S4z9vP6F6fh8rKw+fV3n9 LaVq+RjOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAimycxLDgaZrfPx+GncZ6c v3W+2iHm7qTFxQwLlj9Zsj2v5WPVN7fpifEtrw3kql+mAQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: scsi: target: core: Fix null-ptr-deref in target_alloc_device() There is a null-ptr-deref issue reported by KASAN: BUG: KASAN: null-ptr-deref in target_alloc_device+0xbc4/0xbe0 [target_core_mod] ... kasan_report+0xb9/0xf0 target_alloc_device+0xbc4/0xbe0 [target_core_mod] core_dev_setup_virtual_lun0+0xef/0x1f0 [target_core_mod] target_core_init_configfs+0x205/0x420 [target_core_mod] do_one_initcall+0xdd/0x4e0 ... entry_SYSCALL_64_after_hwframe+0x76/0x7e In target_alloc_device(), if allocing memory for dev queues fails, then dev will be freed by dev->transport->free_device(), but dev->transport is not initialized at that time, which will lead to a null pointer reference problem. Fixing this bug by freeing dev with hba->backend->ops->free_device(). The Linux kernel CVE team has assigned CVE-2024-50153 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit 1526d9f10c61 and fixed in 5.15.170 with commit 39e02fa90323 Issue introduced in 5.11 with commit 1526d9f10c61 and fixed in 6.1.115 with commit 895ab729425e Issue introduced in 5.11 with commit 1526d9f10c61 and fixed in 6.6.59 with commit b80e9bc85bd9 Issue introduced in 5.11 with commit 1526d9f10c61 and fixed in 6.11.6 with commit 14a6a2adb440 Issue introduced in 5.11 with commit 1526d9f10c61 and fixed in 6.12-rc4 with commit fca6caeb4a61 Issue introduced in 5.10.180 with commit 008b936bbde3 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-2024-50153 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_device.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/39e02fa90323243187c91bb3e8f2f5f6a9aacfc7 https://git.kernel.org/stable/c/895ab729425ef9bf3b6d2f8d0853abe64896f314 https://git.kernel.org/stable/c/b80e9bc85bd9af378e7eac83e15dd129557bbdb6 https://git.kernel.org/stable/c/14a6a2adb440e4ae97bee73b2360946bd033dadd https://git.kernel.org/stable/c/fca6caeb4a61d240f031914413fcc69534f6dc03