# CVE-2022-49082: scsi: mpt3sas: Fix use after free in \_scsih\_expander\_node\_remove()

> 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.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-02-26T01:54:42.101Z
- **Modified:** 2026-06-17T05:17:01.797Z

## Who should check

- Anyone running Linux \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 17d66b1c92bcb41e72271ec60069d3684aaa1c9c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 87d663d40801dffc99a5ad3b0188ad3e2b4d1557
- Anyone running Linux 5.11

## Description

In the Linux kernel, the following vulnerability has been resolved:

scsi: mpt3sas: Fix use after free in \_scsih\_expander\_node\_remove()

The function mpt3sas\_transport\_port\_remove() called in
\_scsih\_expander\_node\_remove() frees the port field of the sas\_expander
structure, leading to the following use-after-free splat from KASAN when
the ioc\_info() call following that function is executed (e.g. when doing
rmmod of the driver module):

\[ 3479.371167\] ==================================================================
\[ 3479.378496\] BUG: KASAN: use-after-free in \_scsih\_expander\_node\_remove+0x710/0x750 \[mpt3sas\]
\[ 3479.386936\] Read of size 1 at addr ffff8881c037691c by task rmmod/1531
\[ 3479.393524\]
\[ 3479.395035\] CPU: 18 PID: 1531 Comm: rmmod Not tainted 5.17.0-rc8+ \#1436
\[ 3479.401712\] Hardware name: Supermicro Super Server/H12SSL-NT, BIOS 2.1 06/02/2021
\[ 3479.409263\] Call Trace:
\[ 3479.411743\]  \<TASK\>
\[ 3479.413875\]  dump\_stack\_lvl+0x45/0x59
\[ 3479.417582\]  print\_address\_description.constprop.0+0x1f/0x120
\[ 3479.423389\]  ? \_scsih\_expander\_node\_remove+0x710/0x750 \[mpt3sas\]
\[ 3479.429469\]  kasan\_report.cold+0x83/0xdf
\[ 3479.433438\]  ? \_scsih\_expander\_node\_remove+0x710/0x750 \[mpt3sas\]
\[ 3479.439514\]  \_scsih\_expander\_node\_remove+0x710/0x750 \[mpt3sas\]
\[ 3479.445411\]  ? \_raw\_spin\_unlock\_irqrestore+0x2d/0x40
\[ 3479.452032\]  scsih\_remove+0x525/0xc90 \[mpt3sas\]
\[ 3479.458212\]  ? mpt3sas\_expander\_remove+0x1d0/0x1d0 \[mpt3sas\]
\[ 3479.465529\]  ? down\_write+0xde/0x150
\[ 3479.470746\]  ? up\_write+0x14d/0x460
\[ 3479.475840\]  ? kernfs\_find\_ns+0x137/0x310
\[ 3479.481438\]  pci\_device\_remove+0x65/0x110
\[ 3479.487013\]  \_\_device\_release\_driver+0x316/0x680
\[ 3479.493180\]  driver\_detach+0x1ec/0x2d0
\[ 3479.498499\]  bus\_remove\_driver+0xe7/0x2d0
\[ 3479.504081\]  pci\_unregister\_driver+0x26/0x250
\[ 3479.510033\]  \_mpt3sas\_exit+0x2b/0x6cf \[mpt3sas\]
\[ 3479.516144\]  \_\_x64\_sys\_delete\_module+0x2fd/0x510
\[ 3479.522315\]  ? free\_module+0xaa0/0xaa0
\[ 3479.527593\]  ? \_\_cond\_resched+0x1c/0x90
\[ 3479.532951\]  ? lockdep\_hardirqs\_on\_prepare+0x273/0x3e0
\[ 3479.539607\]  ? syscall\_enter\_from\_user\_mode+0x21/0x70
\[ 3479.546161\]  ? trace\_hardirqs\_on+0x1c/0x110
\[ 3479.551828\]  do\_syscall\_64+0x35/0x80
\[ 3479.556884\]  entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
\[ 3479.563402\] RIP: 0033:0x7f1fc482483b
...
\[ 3479.943087\] ==================================================================

Fix this by introducing the local variable port\_id to store the port ID
value before executing mpt3sas\_transport\_port\_remove(). This local variable
is then used in the call to ioc\_info() instead of dereferencing the freed
port structure.

## Affected and fixed versions

- Linux: \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 17d66b1c92bcb41e72271ec60069d3684aaa1c9c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 87d663d40801dffc99a5ad3b0188ad3e2b4d1557 (cvelist)
- Linux: 5.11 (cvelist)

## Mitigation

- Upgrade Linux to 87d663d40801dffc99a5ad3b0188ad3e2b4d1557 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-49082. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49082.md
Affected: Linux >= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, < 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e; >= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, < 17d66b1c92bcb41e72271ec60069d3684aaa1c9c; >= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, < 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c; >= 7d310f241001e090cf1ec0f…
Fixed in: Linux 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e, Linux 17d66b1c92bcb41e72271ec60069d3684aaa1c9c, Linux 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c, Linux 87d663d40801dffc99a5ad3b0188ad3e2b4d1557

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-49082 being exploited?

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

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

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

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

Linux \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 17d66b1c92bcb41e72271ec60069d3684aaa1c9c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c; \>= 7d310f241001e090cf1ec0f3ae836b38d8c6ebec, \< 87d663d40801dffc99a5ad3b0188ad3e2b4d1557; Linux 5.11.

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

Yes. Fixed in Linux 25c1353dca74ad7cf3fd7ce258fe7c957a147d5e, Linux 17d66b1c92bcb41e72271ec60069d3684aaa1c9c, Linux 1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c, Linux 87d663d40801dffc99a5ad3b0188ad3e2b4d1557. Upgrade Linux to 87d663d40801dffc99a5ad3b0188ad3e2b4d1557 or later.

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

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/25c1353dca74ad7cf3fd7ce258fe7c957a147d5e>
- patch: <https://git.kernel.org/stable/c/17d66b1c92bcb41e72271ec60069d3684aaa1c9c>
- patch: <https://git.kernel.org/stable/c/1bb8a7fc64d63ec818e367e1b37676ea2ef2d20c>
- patch: <https://git.kernel.org/stable/c/87d663d40801dffc99a5ad3b0188ad3e2b4d1557>

## 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-49082>

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