# CVE-2022-50315: ata: ahci: Match EM\_MAX\_SLOTS with SATA\_PMP\_MAX\_PORTS

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.25% (percentile 10, 2026-11-26)
- **CWE:** CWE-129
- **Published:** 2025-09-15T14:46:10.177Z
- **Modified:** 2026-10-15T22:17:29.890Z

## Who should check

- Anyone running Linux \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< f70bd4339cb68bc7e206af4c922bc0d249244403; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< da2ea4a961d9f89ed248734e7032350c260dc3a3; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 67a00c299c5c143817c948fbc7de1a2fa1af38fb; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 383b7c50f5445ff8dbbf03080905648d6980c39d; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 303d0f761431d848dd8d7ff9fd9b8c101879cabe; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 8fbe13de1cc7cef2564be3cbf60400b33eee023b; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< d6314d5f68764550c84d732ce901ddd3ac6b415f; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 1e41e693f458eef2d5728207dbd327cd3b16580a
- Anyone running Linux 2.6.27

## Description

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

## Affected and fixed versions

- Linux: \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< f70bd4339cb68bc7e206af4c922bc0d249244403; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< da2ea4a961d9f89ed248734e7032350c260dc3a3; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 67a00c299c5c143817c948fbc7de1a2fa1af38fb; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 383b7c50f5445ff8dbbf03080905648d6980c39d; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 303d0f761431d848dd8d7ff9fd9b8c101879cabe; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 8fbe13de1cc7cef2564be3cbf60400b33eee023b; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< d6314d5f68764550c84d732ce901ddd3ac6b415f; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 1e41e693f458eef2d5728207dbd327cd3b16580a (cvelist)
- Linux: 2.6.27 (cvelist)

## Mitigation

- Upgrade Linux to 1e41e693f458eef2d5728207dbd327cd3b16580a or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50315. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50315.md
Affected: Linux >= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, < f70bd4339cb68bc7e206af4c922bc0d249244403; >= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, < da2ea4a961d9f89ed248734e7032350c260dc3a3; >= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, < 67a00c299c5c143817c948fbc7de1a2fa1af38fb; >= 18f7ba4c2f4be6b37d92593…
Fixed in: Linux 67a00c299c5c143817c948fbc7de1a2fa1af38fb, Linux 383b7c50f5445ff8dbbf03080905648d6980c39d, Linux 303d0f761431d848dd8d7ff9fd9b8c101879cabe, Linux 8fbe13de1cc7cef2564be3cbf60400b33eee023b, Linux 1e41e693f458eef2d5728207dbd327cd3b16580a

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50315 being exploited?

There is no confirmed exploitation: CVE-2022-50315 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.25% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-50315?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-50315?

Linux \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< f70bd4339cb68bc7e206af4c922bc0d249244403; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< da2ea4a961d9f89ed248734e7032350c260dc3a3; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 67a00c299c5c143817c948fbc7de1a2fa1af38fb; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 383b7c50f5445ff8dbbf03080905648d6980c39d; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 303d0f761431d848dd8d7ff9fd9b8c101879cabe; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 8fbe13de1cc7cef2564be3cbf60400b33eee023b; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< d6314d5f68764550c84d732ce901ddd3ac6b415f; \>= 18f7ba4c2f4be6b37d925931f04d6cc28d88d1ee, \< 1e41e693f458eef2d5728207dbd327cd3b16580a; Linux 2.6.27.

### Is there a fix for CVE-2022-50315?

Yes. Fixed in Linux 67a00c299c5c143817c948fbc7de1a2fa1af38fb, Linux 383b7c50f5445ff8dbbf03080905648d6980c39d, Linux 303d0f761431d848dd8d7ff9fd9b8c101879cabe, Linux 8fbe13de1cc7cef2564be3cbf60400b33eee023b, Linux 1e41e693f458eef2d5728207dbd327cd3b16580a. Upgrade Linux to 1e41e693f458eef2d5728207dbd327cd3b16580a or later.

### How do I check if I'm affected by CVE-2022-50315?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/f70bd4339cb68bc7e206af4c922bc0d249244403>
- patch: <https://git.kernel.org/stable/c/da2ea4a961d9f89ed248734e7032350c260dc3a3>
- patch: <https://git.kernel.org/stable/c/67a00c299c5c143817c948fbc7de1a2fa1af38fb>
- patch: <https://git.kernel.org/stable/c/383b7c50f5445ff8dbbf03080905648d6980c39d>
- patch: <https://git.kernel.org/stable/c/303d0f761431d848dd8d7ff9fd9b8c101879cabe>
- patch: <https://git.kernel.org/stable/c/8fbe13de1cc7cef2564be3cbf60400b33eee023b>
- patch: <https://git.kernel.org/stable/c/d6314d5f68764550c84d732ce901ddd3ac6b415f>
- patch: <https://git.kernel.org/stable/c/1e41e693f458eef2d5728207dbd327cd3b16580a>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50315>

HTML: <https://flawdb.com/CVE-2022-50315> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50315>
