# CVE-2022-50517: mm/huge\_memory: do not clobber swp\_entry\_t during THP split

> 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.21% (percentile 6, 2026-11-26)
- **Published:** 2025-10-07T15:19:12.344Z
- **Modified:** 2026-08-05T08:59:01.931Z

## Who should check

- Anyone running Linux \>= b653db77350c7307a513b81856fe53e94cf42446, \< 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f; \>= b653db77350c7307a513b81856fe53e94cf42446, \< 71e2d666ef85d51834d658830f823560c402b8b6
- Anyone running Linux 5.19

## Description

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

mm/huge\_memory: do not clobber swp\_entry\_t during THP split

The following has been observed when running stressng mmap since commit
b653db77350c ("mm: Clear page-\>private when splitting or migrating a page")

   watchdog: BUG: soft lockup - CPU\#75 stuck for 26s! \[stress-ng:9546\]
   CPU: 75 PID: 9546 Comm: stress-ng Tainted: G            E      6.0.0-revert-b653db77-fix+ \#29 0357d79b60fb09775f678e4f3f64ef0579ad1374
   Hardware name: SGI.COM C2112-4GP3/X10DRT-P-Series, BIOS 2.0a 05/09/2016
   RIP: 0010:xas\_descend+0x28/0x80
   Code: cc cc 0f b6 0e 48 8b 57 08 48 d3 ea 83 e2 3f 89 d0 48 83 c0 04 48 8b 44 c6 08 48 89 77 18 48 89 c1 83 e1 03 48 83 f9 02 75 08 \<48\> 3d fd 00 00 00 76 08 88 57 12 c3 cc cc cc cc 48 c1 e8 02 89 c2
   RSP: 0018:ffffbbf02a2236a8 EFLAGS: 00000246
   RAX: ffff9cab7d6a0002 RBX: ffffe04b0af88040 RCX: 0000000000000002
   RDX: 0000000000000030 RSI: ffff9cab60509b60 RDI: ffffbbf02a2236c0
   RBP: 0000000000000000 R08: ffff9cab60509b60 R09: ffffbbf02a2236c0
   R10: 0000000000000001 R11: ffffbbf02a223698 R12: 0000000000000000
   R13: ffff9cab4e28da80 R14: 0000000000039c01 R15: ffff9cab4e28da88
   FS:  00007fab89b85e40(0000) GS:ffff9cea3fcc0000(0000) knlGS:0000000000000000
   CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
   CR2: 00007fab84e00000 CR3: 00000040b73a4003 CR4: 00000000003706e0
   DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
   DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
   Call Trace:
    \<TASK\>
    xas\_load+0x3a/0x50
    \_\_filemap\_get\_folio+0x80/0x370
    ? put\_swap\_page+0x163/0x360
    pagecache\_get\_page+0x13/0x90
    \_\_try\_to\_reclaim\_swap+0x50/0x190
    scan\_swap\_map\_slots+0x31e/0x670
    get\_swap\_pages+0x226/0x3c0
    folio\_alloc\_swap+0x1cc/0x240
    add\_to\_swap+0x14/0x70
    shrink\_page\_list+0x968/0xbc0
    reclaim\_page\_list+0x70/0xf0
    reclaim\_pages+0xdd/0x120
    madvise\_cold\_or\_pageout\_pte\_range+0x814/0xf30
    walk\_pgd\_range+0x637/0xa30
    \_\_walk\_page\_range+0x142/0x170
    walk\_page\_range+0x146/0x170
    madvise\_pageout+0xb7/0x280
    ? asm\_common\_interrupt+0x22/0x40
    madvise\_vma\_behavior+0x3b7/0xac0
    ? find\_vma+0x4a/0x70
    ? find\_vma+0x64/0x70
    ? madvise\_vma\_anon\_name+0x40/0x40
    madvise\_walk\_vmas+0xa6/0x130
    do\_madvise+0x2f4/0x360
    \_\_x64\_sys\_madvise+0x26/0x30
    do\_syscall\_64+0x5b/0x80
    ? do\_syscall\_64+0x67/0x80
    ? syscall\_exit\_to\_user\_mode+0x17/0x40
    ? do\_syscall\_64+0x67/0x80
    ? syscall\_exit\_to\_user\_mode+0x17/0x40
    ? do\_syscall\_64+0x67/0x80
    ? do\_syscall\_64+0x67/0x80
    ? common\_interrupt+0x8b/0xa0
    entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

The problem can be reproduced with the mmtests config
config-workload-stressng-mmap.  It does not always happen and when it
triggers is variable but it has happened on multiple machines.

The intent of commit b653db77350c patch was to avoid the case where
PG\_private is clear but folio-\>private is not-NULL.  However, THP tail
pages uses page-\>private for "swp\_entry\_t if folio\_test\_swapcache()" as
stated in the documentation for struct folio.  This patch only clobbers
page-\>private for tail pages if the head page was not in swapcache and
warns once if page-\>private had an unexpected value.

## Affected and fixed versions

- Linux: \>= b653db77350c7307a513b81856fe53e94cf42446, \< 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f; \>= b653db77350c7307a513b81856fe53e94cf42446, \< 71e2d666ef85d51834d658830f823560c402b8b6 (cvelist)
- Linux: 5.19 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-50517.md
Affected: Linux >= b653db77350c7307a513b81856fe53e94cf42446, < 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f; >= b653db77350c7307a513b81856fe53e94cf42446, < 71e2d666ef85d51834d658830f823560c402b8b6; Linux 5.19
Fixed in: Linux 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f, Linux 71e2d666ef85d51834d658830f823560c402b8b6

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

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

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

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

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

Linux \>= b653db77350c7307a513b81856fe53e94cf42446, \< 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f; \>= b653db77350c7307a513b81856fe53e94cf42446, \< 71e2d666ef85d51834d658830f823560c402b8b6; Linux 5.19.

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

Yes. Fixed in Linux 8cace0eeb03d6043827faa6cf6c9067a9f05cd9f, Linux 71e2d666ef85d51834d658830f823560c402b8b6. Upgrade Linux to 71e2d666ef85d51834d658830f823560c402b8b6 or later.

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

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/8cace0eeb03d6043827faa6cf6c9067a9f05cd9f>
- patch: <https://git.kernel.org/stable/c/71e2d666ef85d51834d658830f823560c402b8b6>

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

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