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 E2D7554BDA for ; Sun, 28 Apr 2024 13:06:33 +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=1714309594; cv=none; b=uc4uNb0TJmZs52B8qiAlH4QxWIxCkh/0m0rdknpdFRZ9IMCZNDSEAiXc1JPIRumrq7Q+LYi2WsSoeIhGQc5sudHJZwCpuEs5fGIWdc6zP9lPaVftzOrZljW7x9o6SEfdNVdUXr+khd+cFF8iY75P0ew5poyFRdS9jTgisgPuJxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309594; c=relaxed/simple; bh=2Al0lpGCvzDBf6SPypPSjrgb64nrL6bwNpvardluzqc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=OLF31XdOKyVx5/W0bho6BH2brbI5VmK+uvnTcaqscPYJ57XlzNsOu5Pvxk78zNzbG7M916qrJFnWzEDVOrxnEN+PMk08+Z4l/Y7l+U+ay5JDNPNHSxH7kM3brR/UWYlybXTdlL/QuB+u758xnXc1SMDuMJhHDgrJDHnL/BT+vWc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WewHu7SB; 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="WewHu7SB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 501B4C113CC; Sun, 28 Apr 2024 13:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714309593; bh=2Al0lpGCvzDBf6SPypPSjrgb64nrL6bwNpvardluzqc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WewHu7SBxpwurlNmSEcPXOIEWA0EtvjIQGUsT6qGrJoApUW9cX4wHARK6zyT561dw RQmheGV6oQLTObff70ucNVMAtS4+lEgqZrZA5DnhrwvcopP+uJzelZBrhCAzOTVdgq HDCv0MjrboWpXGMMnGOxzWAw2iO7ai6qlRcZq1sY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48666: scsi: core: Fix a use-after-free Date: Sun, 28 Apr 2024 15:05:27 +0200 Message-ID: <2024042801-CVE-2022-48666-4916@gregkh> X-Mailer: git-send-email 2.44.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=3500; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2Al0lpGCvzDBf6SPypPSjrgb64nrL6bwNpvardluzqc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGl6nnV6cx6oH93q/P1XeRNr6qUNll3LZ2RrLjj14rfO8 s5g2ZNcHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR928Mc4UUBZt2TWS0P7F7 fqqXwonKk6/5bRnmZ31LMrPSXvpIJ43befPX/Tn5ffkzAA== 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: core: Fix a use-after-free There are two .exit_cmd_priv implementations. Both implementations use resources associated with the SCSI host. Make sure that these resources are still available when .exit_cmd_priv is called by waiting inside scsi_remove_host() until the tag set has been freed. This commit fixes the following use-after-free: ================================================================== BUG: KASAN: use-after-free in srp_exit_cmd_priv+0x27/0xd0 [ib_srp] Read of size 8 at addr ffff888100337000 by task multipathd/16727 Call Trace: dump_stack_lvl+0x34/0x44 print_report.cold+0x5e/0x5db kasan_report+0xab/0x120 srp_exit_cmd_priv+0x27/0xd0 [ib_srp] scsi_mq_exit_request+0x4d/0x70 blk_mq_free_rqs+0x143/0x410 __blk_mq_free_map_and_rqs+0x6e/0x100 blk_mq_free_tag_set+0x2b/0x160 scsi_host_dev_release+0xf3/0x1a0 device_release+0x54/0xe0 kobject_put+0xa5/0x120 device_release+0x54/0xe0 kobject_put+0xa5/0x120 scsi_device_dev_release_usercontext+0x4c1/0x4e0 execute_in_process_context+0x23/0x90 device_release+0x54/0xe0 kobject_put+0xa5/0x120 scsi_disk_release+0x3f/0x50 device_release+0x54/0xe0 kobject_put+0xa5/0x120 disk_release+0x17f/0x1b0 device_release+0x54/0xe0 kobject_put+0xa5/0x120 dm_put_table_device+0xa3/0x160 [dm_mod] dm_put_device+0xd0/0x140 [dm_mod] free_priority_group+0xd8/0x110 [dm_multipath] free_multipath+0x94/0xe0 [dm_multipath] dm_table_destroy+0xa2/0x1e0 [dm_mod] __dm_destroy+0x196/0x350 [dm_mod] dev_remove+0x10c/0x160 [dm_mod] ctl_ioctl+0x2c2/0x590 [dm_mod] dm_ctl_ioctl+0x5/0x10 [dm_mod] __x64_sys_ioctl+0xb4/0xf0 dm_ctl_ioctl+0x5/0x10 [dm_mod] __x64_sys_ioctl+0xb4/0xf0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The Linux kernel CVE team has assigned CVE-2022-48666 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 65ca846a5314 and fixed in 5.19.12 with commit 2e7eb4c1e8af Issue introduced in 5.7 with commit 65ca846a5314 and fixed in 6.0 with commit 8fe4ce5836e9 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-48666 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/scsi/hosts.c drivers/scsi/scsi_lib.c drivers/scsi/scsi_priv.h drivers/scsi/scsi_scan.c drivers/scsi/scsi_sysfs.c include/scsi/scsi_host.h 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/2e7eb4c1e8af8385de22775bd0be552f59b28c9a https://git.kernel.org/stable/c/8fe4ce5836e932f5766317cb651c1ff2a4cd0506