CVE-2022-48802: fs/proc: task_mmu.c: don't read mapcount for migration entry
In the Linux kernel, the following vulnerability has been resolved:
fs/proc: task_mmu.c: don't read mapcount for migration entry
The syzbot reported the below BUG:
kernel BUG at include/linux/page-flags.h:785!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 4392 Comm: syz-executor560 Not tainted 5.16.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:PageDoubleMap include/linux/page-flags.h:785 [inline]
RIP: 0010:__page_mapcount+0x2d2/0x350 mm/util.c:744
Call Trace:
page_mapcount include/linux/mm.h:837 [inline]
smaps_account+0x470/0xb10 fs/proc/task_mmu.c:466
smaps_pte_entry fs/proc/task_mmu.c:538 [inline]
smaps_pte_range+0x611/0x1250 fs/proc/task_mmu.c:601
walk_pmd_range mm/pagewalk.c:128 [inline]
walk_pud_range mm/pagewalk.c:205 [inline]
walk_p4d_range mm/pagewalk.c:240 [inline]
walk_pgd_range mm/pagewalk.c:277 [inline]
__walk_page_range+0xe23/0x1ea0 mm/pagewalk.c:379
walk_page_vma+0x277/0x350 mm/pagewalk.c:530
smap_gather_stats.part.0+0x148/0x260 fs/proc/task_mmu.c:768
smap_gather_stats fs/proc/task_mmu.c:741 [inline]
show_smap+0xc6/0x440 fs/proc/task_mmu.c:822
seq_read_iter+0xbb0/0x1240 fs/seq_file.c:272
seq_read+0x3e0/0x5b0 fs/seq_file.c:162
vfs_read+0x1b5/0x600 fs/read_write.c:479
ksys_read+0x12d/0x250 fs/read_write.c:619
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
The reproducer was trying to read /proc/$PID/smaps when calling
MADV_FREE at the mean time. MADV_FREE may split THPs if it is called
for partial THP. It may trigger the below race:
CPU A CPU B
----- -----
smaps walk: MADV_FREE:
page_mapcount()
PageCompound()
split_huge_page()
page = compound_head(page)
PageDoubleMap(page)
When calling PageDoubleMap() this page is not a tail page of THP anymore
so the BUG is triggered.
This could be fixed by elevated refcount of the page before calling
mapcount, but that would prevent it from counting migration entries, and
it seems overkilling because the race just could happen when PMD is
split so all PTE entries of tail pages are actually migration entries,
and smaps_account() does treat migration entries as mapcount == 1 as
Kirill pointed out.
Add a new parameter for smaps_account() to tell this entry is migration
entry then skip calling page_mapcount(). Don't skip getting mapcount
for device private entries since they do track references with mapcount.
Pagemap also has the similar issue although it was not reported. Fixed
it as well.
[shy828301@gmail.com: v4]
[nathan@kernel.org: avoid unused variable warning in pagemap_pmd_range()]
Security readout for executives and security teams
Plain-English summary
CVE-2022-48802 is a Linux kernel race condition that can trigger a kernel BUG while reading process memory statistics. The public record describes a crash found by syzbot, not data theft or remote compromise. Business urgency depends on exposure to untrusted local users or workloads and whether affected kernels are deployed.
Executive priority
Treat as a patch-management issue with higher priority on shared compute, developer, container, and HPC systems. There is no cited active exploitation, but a kernel crash can affect service availability.
Technical view
The issue is in fs/proc/task_mmu.c handling of /proc/$PID/smaps and pagemap during concurrent MADV_FREE and transparent huge page splitting. The fix avoids reading page mapcount for migration entries. The reported failure is an invalid opcode kernel BUG in PageDoubleMap/__page_mapcount.
Likely exposure
Systems running affected Linux kernel versions or downstream builds without the referenced stable fixes may be exposed. The scenario requires local process activity involving /proc memory reporting and MADV_FREE behavior, so internet-facing remote exposure is not indicated by the provided sources.
Exploitation context
The source describes a syzbot reproducer and a race condition, but does not cite real-world exploitation. CISA KEV status is false in the provided bundle. Practical impact appears to be local denial of service through kernel crash, based on the reported BUG.
Researcher notes
The public description ties the race to smaps/pagemap walking while MADV_FREE splits transparent huge pages. Evidence is incomplete on exact distro package impact, CVSS, and exploitability beyond the syzbot crash reproducer. Use vendor kernel trees to map commit backports.
Mitigation direction
Apply Linux kernel updates containing the referenced stable commits.
Check distribution advisories for backported fixes for CVE-2022-48802.
Prioritize hosts running untrusted local code or multi-tenant workloads.
If patching is delayed, reduce exposure to untrusted local workloads where feasible.
Validation and detection
Inventory deployed Linux kernel versions across servers and images.
Confirm vendor packages include the CVE-2022-48802 fix or referenced commits.
Review kernel changelogs for fs/proc task_mmu.c mapcount migration-entry fixes.
Check logs for related kernel BUG traces in PageDoubleMap or __page_mapcount.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2022-48802 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.