# CVE-2022-49007: nilfs2: fix NULL pointer dereference in nilfs\_palloc\_commit\_free\_entry()

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; 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.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-10-21T20:06:19.506Z
- **Modified:** 2026-06-17T05:16:50.103Z

## Who should check

- Anyone running Linux \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 2f2c59506ae39496588ceb8b88bdbdbaed895d63; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 165c7a3b27a3857ebf57f626b9f38b48b6792e68; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< bc3fd3293887b4cf84a9109700faeb82de533c89; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 9a130b72e6bd1fb07fc3cde839dc6fb53da76f07; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< e858917ab785afe83c14f5ac141301216ccda847; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 33021419fd81efd3d729a7f19341ba4b98fe66ce; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 381b84f60e549ea98cec4666c6c728b1b3318756; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4
- Anyone running Linux 2.6.30

## Description

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

nilfs2: fix NULL pointer dereference in nilfs\_palloc\_commit\_free\_entry()

Syzbot reported a null-ptr-deref bug:

 NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP
 frequency \< 30 seconds
 general protection fault, probably for non-canonical address
 0xdffffc0000000002: 0000 \[\#1\] PREEMPT SMP KASAN
 KASAN: null-ptr-deref in range \[0x0000000000000010-0x0000000000000017\]
 CPU: 1 PID: 3603 Comm: segctord Not tainted
 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb \#0
 Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google
 10/11/2022
 RIP: 0010:nilfs\_palloc\_commit\_free\_entry+0xe5/0x6b0
 fs/nilfs2/alloc.c:608
 Code: 00 00 00 00 fc ff df 80 3c 02 00 0f 85 cd 05 00 00 48 b8 00 00 00
 00 00 fc ff df 4c 8b 73 08 49 8d 7e 10 48 89 fa 48 c1 ea 03 \<80\> 3c 02
 00 0f 85 26 05 00 00 49 8b 46 10 be a6 00 00 00 48 c7 c7
 RSP: 0018:ffffc90003dff830 EFLAGS: 00010212
 RAX: dffffc0000000000 RBX: ffff88802594e218 RCX: 000000000000000d
 RDX: 0000000000000002 RSI: 0000000000002000 RDI: 0000000000000010
 RBP: ffff888071880222 R08: 0000000000000005 R09: 000000000000003f
 R10: 000000000000000d R11: 0000000000000000 R12: ffff888071880158
 R13: ffff88802594e220 R14: 0000000000000000 R15: 0000000000000004
 FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000)
 knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 00007fb1c08316a8 CR3: 0000000018560000 CR4: 0000000000350ee0
 Call Trace:
  \<TASK\>
  nilfs\_dat\_commit\_free fs/nilfs2/dat.c:114 \[inline\]
  nilfs\_dat\_commit\_end+0x464/0x5f0 fs/nilfs2/dat.c:193
  nilfs\_dat\_commit\_update+0x26/0x40 fs/nilfs2/dat.c:236
  nilfs\_btree\_commit\_update\_v+0x87/0x4a0 fs/nilfs2/btree.c:1940
  nilfs\_btree\_commit\_propagate\_v fs/nilfs2/btree.c:2016 \[inline\]
  nilfs\_btree\_propagate\_v fs/nilfs2/btree.c:2046 \[inline\]
  nilfs\_btree\_propagate+0xa00/0xd60 fs/nilfs2/btree.c:2088
  nilfs\_bmap\_propagate+0x73/0x170 fs/nilfs2/bmap.c:337
  nilfs\_collect\_file\_data+0x45/0xd0 fs/nilfs2/segment.c:568
  nilfs\_segctor\_apply\_buffers+0x14a/0x470 fs/nilfs2/segment.c:1018
  nilfs\_segctor\_scan\_file+0x3f4/0x6f0 fs/nilfs2/segment.c:1067
  nilfs\_segctor\_collect\_blocks fs/nilfs2/segment.c:1197 \[inline\]
  nilfs\_segctor\_collect fs/nilfs2/segment.c:1503 \[inline\]
  nilfs\_segctor\_do\_construct+0x12fc/0x6af0 fs/nilfs2/segment.c:2045
  nilfs\_segctor\_construct+0x8e3/0xb30 fs/nilfs2/segment.c:2379
  nilfs\_segctor\_thread\_construct fs/nilfs2/segment.c:2487 \[inline\]
  nilfs\_segctor\_thread+0x3c3/0xf30 fs/nilfs2/segment.c:2570
  kthread+0x2e4/0x3a0 kernel/kthread.c:376
  ret\_from\_fork+0x1f/0x30 arch/x86/entry/entry\_64.S:306
  \</TASK\>
 ...

If DAT metadata file is corrupted on disk, there is a case where
req-\>pr\_desc\_bh is NULL and blocknr is 0 at nilfs\_dat\_commit\_end() during
a b-tree operation that cascadingly updates ancestor nodes of the b-tree,
because nilfs\_dat\_commit\_alloc() for a lower level block can initialize
the blocknr on the same DAT entry between nilfs\_dat\_prepare\_end() and
nilfs\_dat\_commit\_end().

If this happens, nilfs\_dat\_commit\_end() calls nilfs\_dat\_commit\_free()
without valid buffer heads in req-\>pr\_desc\_bh and req-\>pr\_bitmap\_bh, and
causes the NULL pointer dereference above in
nilfs\_palloc\_commit\_free\_entry() function, which leads to a crash.

Fix this by adding a NULL check on req-\>pr\_desc\_bh and req-\>pr\_bitmap\_bh
before nilfs\_palloc\_commit\_free\_entry() in nilfs\_dat\_commit\_free().

This also calls nilfs\_error() in that case to notify that there is a fatal
flaw in the filesystem metadata and prevent further operations.

## Affected and fixed versions

- Linux: \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 2f2c59506ae39496588ceb8b88bdbdbaed895d63; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 165c7a3b27a3857ebf57f626b9f38b48b6792e68; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< bc3fd3293887b4cf84a9109700faeb82de533c89; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 9a130b72e6bd1fb07fc3cde839dc6fb53da76f07; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< e858917ab785afe83c14f5ac141301216ccda847; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 33021419fd81efd3d729a7f19341ba4b98fe66ce; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 381b84f60e549ea98cec4666c6c728b1b3318756; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4 (cvelist)
- Linux: 2.6.30 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49007. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49007.md
Affected: Linux >= a17564f58b11476c011d623fa1f268602a81c27c, < 2f2c59506ae39496588ceb8b88bdbdbaed895d63; >= a17564f58b11476c011d623fa1f268602a81c27c, < 165c7a3b27a3857ebf57f626b9f38b48b6792e68; >= a17564f58b11476c011d623fa1f268602a81c27c, < bc3fd3293887b4cf84a9109700faeb82de533c89; >= a17564f58b11476c011d623…
Fixed in: Linux 2f2c59506ae39496588ceb8b88bdbdbaed895d63, Linux 165c7a3b27a3857ebf57f626b9f38b48b6792e68, Linux 9a130b72e6bd1fb07fc3cde839dc6fb53da76f07, Linux 33021419fd81efd3d729a7f19341ba4b98fe66ce, Linux 381b84f60e549ea98cec4666c6c728b1b3318756

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

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

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

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

Linux \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 2f2c59506ae39496588ceb8b88bdbdbaed895d63; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 165c7a3b27a3857ebf57f626b9f38b48b6792e68; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< bc3fd3293887b4cf84a9109700faeb82de533c89; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 9a130b72e6bd1fb07fc3cde839dc6fb53da76f07; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< e858917ab785afe83c14f5ac141301216ccda847; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 33021419fd81efd3d729a7f19341ba4b98fe66ce; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< 381b84f60e549ea98cec4666c6c728b1b3318756; \>= a17564f58b11476c011d623fa1f268602a81c27c, \< f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4; Linux 2.6.30.

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

Yes. Fixed in Linux 2f2c59506ae39496588ceb8b88bdbdbaed895d63, Linux 165c7a3b27a3857ebf57f626b9f38b48b6792e68, Linux 9a130b72e6bd1fb07fc3cde839dc6fb53da76f07, Linux 33021419fd81efd3d729a7f19341ba4b98fe66ce, Linux 381b84f60e549ea98cec4666c6c728b1b3318756. No fix listed yet: follow the vendor advisory.

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

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/2f2c59506ae39496588ceb8b88bdbdbaed895d63>
- patch: <https://git.kernel.org/stable/c/165c7a3b27a3857ebf57f626b9f38b48b6792e68>
- patch: <https://git.kernel.org/stable/c/bc3fd3293887b4cf84a9109700faeb82de533c89>
- patch: <https://git.kernel.org/stable/c/9a130b72e6bd1fb07fc3cde839dc6fb53da76f07>
- patch: <https://git.kernel.org/stable/c/e858917ab785afe83c14f5ac141301216ccda847>
- patch: <https://git.kernel.org/stable/c/33021419fd81efd3d729a7f19341ba4b98fe66ce>
- patch: <https://git.kernel.org/stable/c/381b84f60e549ea98cec4666c6c728b1b3318756>
- patch: <https://git.kernel.org/stable/c/f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4>

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

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