# CVE-2022-49851: riscv: fix reserved memory setup

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

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; 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.29% (percentile 14, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-05-01T14:10:06.274Z
- **Modified:** 2026-06-17T05:19:18.380Z

## Who should check

- Anyone running Linux \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 94ab8f88feb75e3b1486102c0c9c550f37d9d137; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 518e49f0590de66555503aabe199ba8d3f2e24ac; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 93598deb101540c4f9e7de15099ea8255b965fc2; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 50e63dd8ed92045eb70a72d7ec725488320fb68b; f18ed5bee7bb8a0e99e1c7e7d45e0e51d3497248; \>= 5.3.8, \< 5.4
- Anyone running Linux 5.4

## Description

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

riscv: fix reserved memory setup

Currently, RISC-V sets up reserved memory using the "early" copy of the
device tree. As a result, when trying to get a reserved memory region
using of\_reserved\_mem\_lookup(), the pointer to reserved memory regions
is using the early, pre-virtual-memory address which causes a kernel
panic when trying to use the buffer's name:

 Unable to handle kernel paging request at virtual address 00000000401c31ac
 Oops \[\#1\]
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper Not tainted 6.0.0-rc1-00001-g0d9d6953d834 \#1
 Hardware name: Microchip PolarFire-SoC Icicle Kit (DT)
 epc : string+0x4a/0xea
  ra : vsnprintf+0x1e4/0x336
 epc : ffffffff80335ea0 ra : ffffffff80338936 sp : ffffffff81203be0
  gp : ffffffff812e0a98 tp : ffffffff8120de40 t0 : 0000000000000000
  t1 : ffffffff81203e28 t2 : 7265736572203a46 s0 : ffffffff81203c20
  s1 : ffffffff81203e28 a0 : ffffffff81203d22 a1 : 0000000000000000
  a2 : ffffffff81203d08 a3 : 0000000081203d21 a4 : ffffffffffffffff
  a5 : 00000000401c31ac a6 : ffff0a00ffffff04 a7 : ffffffffffffffff
  s2 : ffffffff81203d08 s3 : ffffffff81203d00 s4 : 0000000000000008
  s5 : ffffffff000000ff s6 : 0000000000ffffff s7 : 00000000ffffff00
  s8 : ffffffff80d9821a s9 : ffffffff81203d22 s10: 0000000000000002
  s11: ffffffff80d9821c t3 : ffffffff812f3617 t4 : ffffffff812f3617
  t5 : ffffffff812f3618 t6 : ffffffff81203d08
 status: 0000000200000100 badaddr: 00000000401c31ac cause: 000000000000000d
 \[\<ffffffff80338936\>\] vsnprintf+0x1e4/0x336
 \[\<ffffffff80055ae2\>\] vprintk\_store+0xf6/0x344
 \[\<ffffffff80055d86\>\] vprintk\_emit+0x56/0x192
 \[\<ffffffff80055ed8\>\] vprintk\_default+0x16/0x1e
 \[\<ffffffff800563d2\>\] vprintk+0x72/0x80
 \[\<ffffffff806813b2\>\] \_printk+0x36/0x50
 \[\<ffffffff8068af48\>\] print\_reserved\_mem+0x1c/0x24
 \[\<ffffffff808057ec\>\] paging\_init+0x528/0x5bc
 \[\<ffffffff808031ae\>\] setup\_arch+0xd0/0x592
 \[\<ffffffff8080070e\>\] start\_kernel+0x82/0x73c

early\_init\_fdt\_scan\_reserved\_mem() takes no arguments as it operates on
initial\_boot\_params, which is populated by early\_init\_dt\_verify(). On
RISC-V, early\_init\_dt\_verify() is called twice. Once, directly, in
setup\_arch() if CONFIG\_BUILTIN\_DTB is not enabled and once indirectly,
very early in the boot process, by parse\_dtb() when it calls
early\_init\_dt\_scan\_nodes().

This first call uses dtb\_early\_va to set initial\_boot\_params, which is
not usable later in the boot process when
early\_init\_fdt\_scan\_reserved\_mem() is called. On arm64 for example, the
corresponding call to early\_init\_dt\_scan\_nodes() uses fixmap addresses
and doesn't suffer the same fate.

Move early\_init\_fdt\_scan\_reserved\_mem() further along the boot sequence,
after the direct call to early\_init\_dt\_verify() in setup\_arch() so that
the names use the correct virtual memory addresses. The above supposed
that CONFIG\_BUILTIN\_DTB was not set, but should work equally in the case
where it is - unflatted\_and\_copy\_device\_tree() also updates
initial\_boot\_params.

## Affected and fixed versions

- Linux: \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 94ab8f88feb75e3b1486102c0c9c550f37d9d137; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 518e49f0590de66555503aabe199ba8d3f2e24ac; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 93598deb101540c4f9e7de15099ea8255b965fc2; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 50e63dd8ed92045eb70a72d7ec725488320fb68b; f18ed5bee7bb8a0e99e1c7e7d45e0e51d3497248; \>= 5.3.8, \< 5.4 (cvelist)
- Linux: 5.4 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49851.md
Affected: Linux >= 922b0375fc93fb1a20c5617e37c389c26bbccb70, < 94ab8f88feb75e3b1486102c0c9c550f37d9d137; >= 922b0375fc93fb1a20c5617e37c389c26bbccb70, < 518e49f0590de66555503aabe199ba8d3f2e24ac; >= 922b0375fc93fb1a20c5617e37c389c26bbccb70, < 93598deb101540c4f9e7de15099ea8255b965fc2; >= 922b0375fc93fb1a20c5617…
Fixed in: Linux 94ab8f88feb75e3b1486102c0c9c550f37d9d137, Linux 518e49f0590de66555503aabe199ba8d3f2e24ac, Linux 93598deb101540c4f9e7de15099ea8255b965fc2, Linux 50e63dd8ed92045eb70a72d7ec725488320fb68b, Linux 5.4

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

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

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

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

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

Linux \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 94ab8f88feb75e3b1486102c0c9c550f37d9d137; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 518e49f0590de66555503aabe199ba8d3f2e24ac; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 93598deb101540c4f9e7de15099ea8255b965fc2; \>= 922b0375fc93fb1a20c5617e37c389c26bbccb70, \< 50e63dd8ed92045eb70a72d7ec725488320fb68b; f18ed5bee7bb8a0e99e1c7e7d45e0e51d3497248; \>= 5.3.8, \< 5.4; Linux 5.4.

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

Yes. Fixed in Linux 94ab8f88feb75e3b1486102c0c9c550f37d9d137, Linux 518e49f0590de66555503aabe199ba8d3f2e24ac, Linux 93598deb101540c4f9e7de15099ea8255b965fc2, Linux 50e63dd8ed92045eb70a72d7ec725488320fb68b, Linux 5.4. Upgrade Linux to 5.4 or later.

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

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/94ab8f88feb75e3b1486102c0c9c550f37d9d137>
- patch: <https://git.kernel.org/stable/c/518e49f0590de66555503aabe199ba8d3f2e24ac>
- patch: <https://git.kernel.org/stable/c/93598deb101540c4f9e7de15099ea8255b965fc2>
- patch: <https://git.kernel.org/stable/c/50e63dd8ed92045eb70a72d7ec725488320fb68b>

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

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