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 61421290D81 for ; Tue, 30 Dec 2025 12:10:54 +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=1767096654; cv=none; b=A1vJZV4KZBs98XkdjME20kfTR0VQzz2fPO4gOYw6u31kTDI7m9VhLK4nJa9wbks7gw2XwsAPPJ3FFYX22RKlR7K+ON3THlNk35RZ5ee66E01wIqTg0xZvM9FR0yoNHWip6t36T10QGkndSGu9C6gV/GM/QH+Z0JecVYIksK4KrE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767096654; c=relaxed/simple; bh=YKYxyxoQ2lgzQugxNo8R7LurGqeivVZDc6D5xiNQHtE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=r8jHY9UGyBfj+JYZ/KV5D62N6AmK9pWM/zjdKLA/9Kx49ia46LYIU4qPzZtqKtyivCmGnhMDwXHj40zTGrMwfKeFQ7aLWPqavLfTKOI5Dkhid4l2yBh34ycWkI2sxhs8sheGD4PumrGyL6bkFbwtknYM7Xe995yEfo9xRh+T7sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ggMPJhbO; 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="ggMPJhbO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6A85C4CEFB; Tue, 30 Dec 2025 12:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767096654; bh=YKYxyxoQ2lgzQugxNo8R7LurGqeivVZDc6D5xiNQHtE=; h=From:To:Cc:Subject:Date:Reply-To:From; b=ggMPJhbOHNAWj3Z1TCXVDJ0iRvkSjyoEy5sccVOAOvDZDyAWCGg3327re/p8eTPaP Ata3DkjlY20abhMbpfgJ62LP7sAwKTiUCr0WymEF670yfMhonFjuIwKrQW+L1ueh/S mUDIV3BnLuPPtZZhOr9Fcn+/dWqAK5XPevNqEzEg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50818: scsi: pm8001: Fix running_req for internal abort commands Date: Tue, 30 Dec 2025 13:09:22 +0100 Message-ID: <2025123015-CVE-2022-50818-cbfd@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4137; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=1IKVrWSa926Tzv0rYoOoZenIeGbSrhfbsAoXL8OBITE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnBB15Hla8+YNt9o1XYe6Gd/PZJCg+6+w7Y8DWq3vDZ4 LHKuNK/I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSGciwYMvts2f2upRrMnQo dK8V9n2nH3o0i2HBtc9B3X9/9/wVkYsLY7567Pp1XsZ6AA== 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: pm8001: Fix running_req for internal abort commands Disabling the remote phy for a SATA disk causes a hang: root@(none)$ more /sys/class/sas_phy/phy-0:0:8/target_port_protocols sata root@(none)$ echo 0 > sys/class/sas_phy/phy-0:0:8/enable root@(none)$ [ 67.855950] sas: ex 500e004aaaaaaa1f phy08 change count has changed [ 67.920585] sd 0:0:2:0: [sdc] Synchronizing SCSI cache [ 67.925780] sd 0:0:2:0: [sdc] Synchronize Cache(10) failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK [ 67.935094] sd 0:0:2:0: [sdc] Stopping disk [ 67.939305] sd 0:0:2:0: [sdc] Start/Stop Unit failed: Result: hostbyte=0x04 driverbyte=DRIVER_OK ... [ 123.998998] INFO: task kworker/u192:1:642 blocked for more than 30 seconds. [ 124.005960] Not tainted 6.0.0-rc1-205202-gf26f8f761e83 #218 [ 124.012049] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 124.019872] task:kworker/u192:1 state:D stack:0 pid: 642 ppid: 2 flags:0x00000008 [ 124.028223] Workqueue: 0000:04:00.0_event_q sas_port_event_worker [ 124.034319] Call trace: [ 124.036758] __switch_to+0x128/0x278 [ 124.040333] __schedule+0x434/0xa58 [ 124.043820] schedule+0x94/0x138 [ 124.047045] schedule_timeout+0x2fc/0x368 [ 124.051052] wait_for_completion+0xdc/0x200 [ 124.055234] __flush_workqueue+0x1a8/0x708 [ 124.059328] sas_porte_broadcast_rcvd+0xa8/0xc0 [ 124.063858] sas_port_event_worker+0x60/0x98 [ 124.068126] process_one_work+0x3f8/0x660 [ 124.072134] worker_thread+0x70/0x700 [ 124.075793] kthread+0x1a4/0x1b8 [ 124.079014] ret_from_fork+0x10/0x20 The issue is that the per-device running_req read in pm8001_dev_gone_notify() never goes to zero and we never make progress. This is caused by missing accounting for running_req for when an internal abort command completes. In commit 2cbbf489778e ("scsi: pm8001: Use libsas internal abort support") we started to send internal abort commands as a proper sas_task. In this when we deliver a sas_task to HW the per-device running_req is incremented in pm8001_queue_command(). However it is never decremented for internal abort commnds, so decrement in pm8001_mpi_task_abort_resp(). The Linux kernel CVE team has assigned CVE-2022-50818 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 2cbbf489778eb9dde51392ec5f74ae2868e4b857 and fixed in 5.19.17 with commit 4e750e0d8e486569fcb7f4ba6f6471673ce7d8a2 Issue introduced in 5.18 with commit 2cbbf489778eb9dde51392ec5f74ae2868e4b857 and fixed in 6.0.3 with commit a62b9fc9775fbc8e666bb328f6e53c168054d6fe Issue introduced in 5.18 with commit 2cbbf489778eb9dde51392ec5f74ae2868e4b857 and fixed in 6.1 with commit d8c22c4697c11ed28062afe3c2b377025be11a23 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-50818 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/pm8001/pm8001_hwi.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/4e750e0d8e486569fcb7f4ba6f6471673ce7d8a2 https://git.kernel.org/stable/c/a62b9fc9775fbc8e666bb328f6e53c168054d6fe https://git.kernel.org/stable/c/d8c22c4697c11ed28062afe3c2b377025be11a23