# CVE-2022-49196: powerpc/pseries: Fix use after free in remove\_phb\_dynamic()

> 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:55:40.626Z
- **Modified:** 2026-06-17T05:17:21.210Z

## Who should check

- Anyone running Linux \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 33d39efb61a84e055ca2386157d39ebbdf6b7d31; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 895ca4ae1f72e0a0160ab162723e59c9f265ec93; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< fe2640bd7a62f1f7c3f55fbda31084085075bc30; c3e740838fe3117413425c956ac56a5724ccd9f9; 83573addff2b4e16df9fad9a561a0d77d554b370; \>= 3.16.39, \< 3.17; \>= 4.7.8, \< 4.8
- Anyone running Linux 4.8

## Description

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

powerpc/pseries: Fix use after free in remove\_phb\_dynamic()

In remove\_phb\_dynamic() we use &phb-\>io\_resource, after we've called
device\_unregister(&host\_bridge-\>dev). But the unregister may have freed
phb, because pcibios\_free\_controller\_deferred() is the release function
for the host\_bridge.

If there are no outstanding references when we call device\_unregister()
then phb will be freed out from under us.

This has gone mainly unnoticed, but with slub\_debug and page\_poison
enabled it can lead to a crash:

  PID: 7574   TASK: c0000000d492cb80  CPU: 13  COMMAND: "drmgr"
   \#0 \[c0000000e4f075a0\] crash\_kexec at c00000000027d7dc
   \#1 \[c0000000e4f075d0\] oops\_end at c000000000029608
   \#2 \[c0000000e4f07650\] \_\_bad\_page\_fault at c0000000000904b4
   \#3 \[c0000000e4f076c0\] do\_bad\_slb\_fault at c00000000009a5a8
   \#4 \[c0000000e4f076f0\] data\_access\_slb\_common\_virt at c000000000008b30
   Data SLB Access \[380\] exception frame:
   R0:  c000000000167250    R1:  c0000000e4f07a00    R2:  c000000002a46100
   R3:  c000000002b39ce8    R4:  00000000000000c0    R5:  00000000000000a9
   R6:  3894674d000000c0    R7:  0000000000000000    R8:  00000000000000ff
   R9:  0000000000000100    R10: 6b6b6b6b6b6b6b6b    R11: 0000000000008000
   R12: c00000000023da80    R13: c0000009ffd38b00    R14: 0000000000000000
   R15: 000000011c87f0f0    R16: 0000000000000006    R17: 0000000000000003
   R18: 0000000000000002    R19: 0000000000000004    R20: 0000000000000005
   R21: 000000011c87ede8    R22: 000000011c87c5a8    R23: 000000011c87d3a0
   R24: 0000000000000000    R25: 0000000000000001    R26: c0000000e4f07cc8
   R27: c00000004d1cc400    R28: c0080000031d00e8    R29: c00000004d23d800
   R30: c00000004d1d2400    R31: c00000004d1d2540
   NIP: c000000000167258    MSR: 8000000000009033    OR3: c000000000e9f474
   CTR: 0000000000000000    LR:  c000000000167250    XER: 0000000020040003
   CCR: 0000000024088420    MQ:  0000000000000000    DAR: 6b6b6b6b6b6b6ba3
   DSISR: c0000000e4f07920     Syscall Result: fffffffffffffff2
   \[NIP  : release\_resource+56\]
   \[LR   : release\_resource+48\]
   \#5 \[c0000000e4f07a00\] release\_resource at c000000000167258  (unreliable)
   \#6 \[c0000000e4f07a30\] remove\_phb\_dynamic at c000000000105648
   \#7 \[c0000000e4f07ab0\] dlpar\_remove\_slot at c0080000031a09e8 \[rpadlpar\_io\]
   \#8 \[c0000000e4f07b50\] remove\_slot\_store at c0080000031a0b9c \[rpadlpar\_io\]
   \#9 \[c0000000e4f07be0\] kobj\_attr\_store at c000000000817d8c
  \#10 \[c0000000e4f07c00\] sysfs\_kf\_write at c00000000063e504
  \#11 \[c0000000e4f07c20\] kernfs\_fop\_write\_iter at c00000000063d868
  \#12 \[c0000000e4f07c70\] new\_sync\_write at c00000000054339c
  \#13 \[c0000000e4f07d10\] vfs\_write at c000000000546624
  \#14 \[c0000000e4f07d60\] ksys\_write at c0000000005469f4
  \#15 \[c0000000e4f07db0\] system\_call\_exception at c000000000030840
  \#16 \[c0000000e4f07e10\] system\_call\_vectored\_common at c00000000000c168

To avoid it, we can take a reference to the host\_bridge-\>dev until we're
done using phb. Then when we drop the reference the phb will be freed.

## Affected and fixed versions

- Linux: \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 33d39efb61a84e055ca2386157d39ebbdf6b7d31; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 895ca4ae1f72e0a0160ab162723e59c9f265ec93; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< fe2640bd7a62f1f7c3f55fbda31084085075bc30; c3e740838fe3117413425c956ac56a5724ccd9f9; 83573addff2b4e16df9fad9a561a0d77d554b370; \>= 3.16.39, \< 3.17; \>= 4.7.8, \< 4.8 (cvelist)
- Linux: 4.8 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49196.md
Affected: Linux >= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, < 33d39efb61a84e055ca2386157d39ebbdf6b7d31; >= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, < 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f; >= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, < 895ca4ae1f72e0a0160ab162723e59c9f265ec93; >= 2dd9c11b9d4dfbd6c070eab…
Fixed in: Linux 33d39efb61a84e055ca2386157d39ebbdf6b7d31, Linux 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f, Linux 895ca4ae1f72e0a0160ab162723e59c9f265ec93, Linux 3.17, Linux 4.8

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

There is no confirmed exploitation: CVE-2022-49196 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-49196?

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

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

Linux \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 33d39efb61a84e055ca2386157d39ebbdf6b7d31; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< 895ca4ae1f72e0a0160ab162723e59c9f265ec93; \>= 2dd9c11b9d4dfbd6c070eab7b81197f65e82f1a0, \< fe2640bd7a62f1f7c3f55fbda31084085075bc30; c3e740838fe3117413425c956ac56a5724ccd9f9; 83573addff2b4e16df9fad9a561a0d77d554b370; \>= 3.16.39, \< 3.17; \>= 4.7.8, \< 4.8; Linux 4.8.

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

Yes. Fixed in Linux 33d39efb61a84e055ca2386157d39ebbdf6b7d31, Linux 403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f, Linux 895ca4ae1f72e0a0160ab162723e59c9f265ec93, Linux 3.17, Linux 4.8. Upgrade Linux to 4.8 or later.

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

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/33d39efb61a84e055ca2386157d39ebbdf6b7d31>
- patch: <https://git.kernel.org/stable/c/403f9e0bc5535a0a5184d1352fa3a70e6ffacb6f>
- patch: <https://git.kernel.org/stable/c/895ca4ae1f72e0a0160ab162723e59c9f265ec93>
- patch: <https://git.kernel.org/stable/c/fe2640bd7a62f1f7c3f55fbda31084085075bc30>

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

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