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 3A1832E2DFB for ; Tue, 7 Oct 2025 15:20:24 +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=1759850424; cv=none; b=DIM7OmBiKz58mRSbAzSQjBzS+kTm1pdYYHsEl8zbbu7YkfqEilmzvRTYiMiAruOn+vdEOPZpvTFH/1w7i1l85qtw/PmlzZRNCSKl5lUiJVhZ3Noph1omzqYYxAbJMmKJQV8iKpvHtZGGkw6qftsI3QOfpFwajcTv2k/RnJ9yN+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759850424; c=relaxed/simple; bh=sh3Vqw1ZuuTYUYMDTpcapKLn2kaohZe0NECOextMGkY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FL3eIjCFtc0+p3pijloQmYGdoIIuFa8uiykj2hPeRtrd2aXYwzHvk+aEupskkvVeU0JipexmuavGTRSVR5OU5+BRRRORuUr29W9Jx6M2TayImmgQe5233UyvXyRho628uEwzMjED3YqxyHxhVJDJVX3gTn66mO/eHuycHzh96w8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=QmKVfRf4; 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="QmKVfRf4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B49BDC4CEF7; Tue, 7 Oct 2025 15:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759850424; bh=sh3Vqw1ZuuTYUYMDTpcapKLn2kaohZe0NECOextMGkY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=QmKVfRf42sJiJvwzSUrLV93Yv0O4NrPt9ENWNVJdiw6E13nnfXGLtJN3ZX4ONW1Me CxSWYiFASXh8J9YBNjGa6mABijZQtmTCVjkeEIGDSh/bnz34aXkDYjdm7ayD5FnSjp X1i+Ttf9if/YBDQ+SdkubayOqsIcbvOYIWsv6q5E= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50532: scsi: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add() Date: Tue, 7 Oct 2025 17:19:19 +0200 Message-ID: <2025100708-CVE-2022-50532-430b@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=4196; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=nTyKfUG2UeBwzXHsYfUgWgcEG5ZNPq5bimLo4BflfnA=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlP9XPOz8/s4TFN/dx99G+cinJdiDjH3PPP6gst9W/uq 05WWsPeEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABM5M59hwYLoCT/U9aXSu6qq aqI6H/qc3iafwbCgR8k11OsJw8QjHJO3fopetHH+trOmAA== 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: mpt3sas: Fix possible resource leaks in mpt3sas_transport_port_add() In mpt3sas_transport_port_add(), if sas_rphy_add() returns error, sas_rphy_free() needs be called to free the resource allocated in sas_end_device_alloc(). Otherwise a kernel crash will happen: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000108 CPU: 45 PID: 37020 Comm: bash Kdump: loaded Tainted: G W 6.1.0-rc1+ #189 pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : device_del+0x54/0x3d0 lr : device_del+0x37c/0x3d0 Call trace: device_del+0x54/0x3d0 attribute_container_class_device_del+0x28/0x38 transport_remove_classdev+0x6c/0x80 attribute_container_device_trigger+0x108/0x110 transport_remove_device+0x28/0x38 sas_rphy_remove+0x50/0x78 [scsi_transport_sas] sas_port_delete+0x30/0x148 [scsi_transport_sas] do_sas_phy_delete+0x78/0x80 [scsi_transport_sas] device_for_each_child+0x68/0xb0 sas_remove_children+0x30/0x50 [scsi_transport_sas] sas_rphy_remove+0x38/0x78 [scsi_transport_sas] sas_port_delete+0x30/0x148 [scsi_transport_sas] do_sas_phy_delete+0x78/0x80 [scsi_transport_sas] device_for_each_child+0x68/0xb0 sas_remove_children+0x30/0x50 [scsi_transport_sas] sas_remove_host+0x20/0x38 [scsi_transport_sas] scsih_remove+0xd8/0x420 [mpt3sas] Because transport_add_device() is not called when sas_rphy_add() fails, the device is not added. When sas_rphy_remove() is subsequently called to remove the device in the remove() path, a NULL pointer dereference happens. The Linux kernel CVE team has assigned CVE-2022-50532 to this issue. Affected and fixed versions =========================== Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 5.4.229 with commit d60000cb1195a464080b0efb4949daf7594e0020 Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 5.10.163 with commit ce1a69cc85006b494353911b35171da195d79e25 Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 5.15.86 with commit 6a92129c8f999ff5b122c100ce7f625eb3e98c4b Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 6.0.16 with commit 6f6768e2fc8638fabdd8802c2ef693d7aef01db1 Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 6.1.2 with commit d17bca3ddfe507874cb826d32721552da12e741f Issue introduced in 3.8 with commit f92363d12359498f9a9960511de1a550f0ec41c2 and fixed in 6.2 with commit 78316e9dfc24906dd474630928ed1d3c562b568e 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-50532 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/mpt3sas/mpt3sas_transport.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/d60000cb1195a464080b0efb4949daf7594e0020 https://git.kernel.org/stable/c/ce1a69cc85006b494353911b35171da195d79e25 https://git.kernel.org/stable/c/6a92129c8f999ff5b122c100ce7f625eb3e98c4b https://git.kernel.org/stable/c/6f6768e2fc8638fabdd8802c2ef693d7aef01db1 https://git.kernel.org/stable/c/d17bca3ddfe507874cb826d32721552da12e741f https://git.kernel.org/stable/c/78316e9dfc24906dd474630928ed1d3c562b568e