CVE-2022-50315 json
ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS
published 2025-09-15 13 mo ago modified 2026-10-15 24 d ago also EUVD-2022-55540
- cvss
- 7.8
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 6%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS
UBSAN complains about array-index-out-of-bounds: [ 1.980703] kernel: UBSAN: array-index-out-of-bounds in /build/linux-9H675w/linux-5.15.0/drivers/ata/libahci.c:968:41 [ 1.980709] kernel: index 15 is out of range for type 'ahci_em_priv [8]' [ 1.980713] kernel: CPU: 0 PID: 209 Comm: scsi_eh_8 Not tainted 5.15.0-25-generic #25-Ubuntu [ 1.980716] kernel: Hardware name: System manufacturer System Product Name/P5Q3, BIOS 1102 06/11/2010 [ 1.980718] kernel: Call Trace: [ 1.980721] kernel: <TASK> [ 1.980723] kernel: show_stack+0x52/0x58 [ 1.980729] kernel: dump_stack_lvl+0x4a/0x5f [ 1.980734] kernel: dump_stack+0x10/0x12 [ 1.980736] kernel: ubsan_epilogue+0x9/0x45 [ 1.980739] kernel: __ubsan_handle_out_of_bounds.cold+0x44/0x49 [ 1.980742] kernel: ahci_qc_issue+0x166/0x170 [libahci] [ 1.980748] kernel: ata_qc_issue+0x135/0x240 [ 1.980752] kernel: ata_exec_internal_sg+0x2c4/0x580 [ 1.980754] kernel: ? vprintk_default+0x1d/0x20 [ 1.980759] kernel: ata_exec_internal+0x67/0xa0 [ 1.980762] kernel: sata_pmp_read+0x8d/0xc0 [ 1.980765] kernel: sata_pmp_read_gscr+0x3c/0x90 [ 1.980768] kernel: sata_pmp_attach+0x8b/0x310 [ 1.980771] kernel: ata_eh_revalidate_and_attach+0x28c/0x4b0 [ 1.980775] kernel: ata_eh_recover+0x6b6/0xb30 [ 1.980778] kernel: ? ahci_do_hardreset+0x180/0x180 [libahci] [ 1.980783] kernel: ? ahci_stop_engine+0xb0/0xb0 [libahci] [ 1.980787] kernel: ? ahci_do_softreset+0x290/0x290 [libahci] [ 1.980792] kernel: ? trace_event_raw_event_ata_eh_link_autopsy_qc+0xe0/0xe0 [ 1.980795] kernel: sata_pmp_eh_recover.isra.0+0x214/0x560 [ 1.980799] kernel: sata_pmp_error_handler+0x23/0x40 [ 1.980802] kernel: ahci_error_handler+0x43/0x80 [libahci] [ 1.980806] kernel: ata_scsi_port_error_handler+0x2b1/0x600 [ 1.980810] kernel: ata_scsi_error+0x9c/0xd0 [ 1.980813] kernel: scsi_error_handler+0xa1/0x180 [ 1.980817] kernel: ? scsi_unjam_host+0x1c0/0x1c0 [ 1.980820] kernel: kthread+0x12a/0x150 [ 1.980823] kernel: ? set_kthread_struct+0x50/0x50 [ 1.980826] kernel: ret_from_fork+0x22/0x30 [ 1.980831] kernel: </TASK>
This happens because sata_pmp_init_links() initialize link->pmp up to SATA_PMP_MAX_PORTS while em_priv is declared as 8 elements array.
I can't find the maximum Enclosure Management ports specified in AHCI spec v1.3.1, but "12.2.1 LED message type" states that "Port Multiplier Information" can utilize 4 bits, which implies it can support up to 16 ports. Hence, use SATA_PMP_MAX_PORTS as EM_MAX_SLOTS to resolve the issue.
BugLink: https://bugs.launchpad.net/bugs/1970074
Patch / fix
- Linux Linux 4.9.332, 4.14.298, 4.19.264, 5.4.221, 5.10.152, 5.15.76, 6.0.6, 6.1
- linux Debian 14, Debian 13, Debian 12 6.0.6-1
debian advisories DEBIAN-CVE-2022-50315
- linux Ubuntu 18.04 LTS 4.15.0-204.215
- linux Ubuntu 20.04 LTS 5.4.0-139.156
- linux Ubuntu 22.04 LTS 5.15.0-60.66
- linux-aws Ubuntu 18.04 LTS 4.15.0-1150.163
- linux-aws Ubuntu 20.04 LTS 5.4.0-1096.104
- linux-aws Ubuntu 22.04 LTS 5.15.0-1030.34
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1100.109
- linux-gcp Ubuntu 22.04 LTS 5.15.0-1029.36
ubuntu advisories UBUNTU-CVE-2022-50315
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- git.kernel.org/stable/c/f70bd4339cb68bc7e206af4c922bc0d249244403 commit
- git.kernel.org/stable/c/da2ea4a961d9f89ed248734e7032350c260dc3a3 commit
- git.kernel.org/stable/c/67a00c299c5c143817c948fbc7de1a2fa1af38fb commit
- git.kernel.org/stable/c/383b7c50f5445ff8dbbf03080905648d6980c39d commit
- git.kernel.org/stable/c/303d0f761431d848dd8d7ff9fd9b8c101879cabe commit
- git.kernel.org/stable/c/8fbe13de1cc7cef2564be3cbf60400b33eee023b commit
- git.kernel.org/stable/c/d6314d5f68764550c84d732ce901ddd3ac6b415f commit
- git.kernel.org/stable/c/1e41e693f458eef2d5728207dbd327cd3b16580a commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-50315 updated cvss 4.5
kernel: ata: ahci: Match EM_MAX_SLOTS with SATA_PMP_MAX_PORTS
-
Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 moreaffected: workaround, no fix available
-
Red Hat Enterprise Linux AppStream E4S (v.9.2) perf 5.14.0-284.200.1.el9_2, rtla 5.14.0-284.200.1.el9_2, kernel-devel-matched 5.14.0-284.200.1.el9_2, kernel-64k-devel-matched 5.14.0-284.200.1.el9_2, kernel-debug-devel-matched 5.14.0-284.200.1.el9_2, kernel-debuginfo-common-s390x 5.14.0-284.200.1.el9_2, +5 more Red Hat Enterprise Linux BaseOS E4S (v.9.2) bpftool 7.0.0-284.200.1.el9_2, kernel 5.14.0-284.200.1.el9_2, kernel-64k 5.14.0-284.200.1.el9_2, kernel-core 5.14.0-284.200.1.el9_2, kernel-tools 5.14.0-284.200.1.el9_2, python3-perf 5.14.0-284.200.1.el9_2, +28 morefixed: vendor fix RHSA-2026:92993
-
Red Hat Enterprise Linux Real Time E4S (v.9.2) kernel-rt 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-core 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-modules 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-debug-core 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-modules-core 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-debug-modules 5.14.0-284.200.1.rt14.485.el9_2, +4 more Red Hat Enterprise Linux Real Time for NFV E4S (v.9.2) kernel-rt 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-kvm 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-core 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-modules 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-debug-kvm 5.14.0-284.200.1.rt14.485.el9_2, kernel-rt-debug-core 5.14.0-284.200.1.rt14.485.el9_2, +6 morefixed: vendor fix RHSA-2026:93047
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- total
- Assessed
- 24 d ago
Exploit prediction
0.17% chance of exploitation in the next 30 days, higher than 6% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-129 Improper Validation of Array Index
- Technology feeds
References
-
git.kernel.org
/stable/c/f70bd4339cb68bc7e206af4c922bc0d249244403
patch
-
git.kernel.org
/stable/c/da2ea4a961d9f89ed248734e7032350c260dc3a3
patch
-
git.kernel.org
/stable/c/67a00c299c5c143817c948fbc7de1a2fa1af38fb
patch
-
git.kernel.org
/stable/c/383b7c50f5445ff8dbbf03080905648d6980c39d
patch
-
git.kernel.org
/stable/c/303d0f761431d848dd8d7ff9fd9b8c101879cabe
patch
-
git.kernel.org
/stable/c/8fbe13de1cc7cef2564be3cbf60400b33eee023b
patch
-
git.kernel.org
/stable/c/d6314d5f68764550c84d732ce901ddd3ac6b415f
patch
-
git.kernel.org
/stable/c/1e41e693f458eef2d5728207dbd327cd3b16580a
patch
Sources
- CVE List CVE-2022-50315
- NVD CVE-2022-50315
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.