# CVE-2022-50478: nilfs2: fix shift-out-of-bounds/overflow in nilfs\_sb2\_bad\_offset()

> 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-125
- **Published:** 2025-10-04T15:16:38.346Z
- **Modified:** 2026-06-17T05:23:38.103Z

## Who should check

- Anyone running Linux \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 6b0ea3df56cccd53398d0289f399f19d43136b2e; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< a6f89b10042baca218c8598d6db5a44c7e32625f; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 9b3ba54025357440d6c4414c670984f628c6f6bf; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d706485dffbbbf848e681edda29c7a46ac55698c; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d464b035c0613856d012cf1704879d3ff3f057fb; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< b47f5c579c8186f7f5ab5e4254e0734ea5b7bf7a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 1012ff77284e3bec0ec0a35a820b03ec43dec2cc; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 62d11ec205ef14d8acf172cfc9904fdbf200025a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 610a2a3d7d8be3537458a378ec69396a76c385b6
- Anyone running Linux 2.6.30

## Description

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

nilfs2: fix shift-out-of-bounds/overflow in nilfs\_sb2\_bad\_offset()

Patch series "nilfs2: fix UBSAN shift-out-of-bounds warnings on mount
time".

The first patch fixes a bug reported by syzbot, and the second one fixes
the remaining bug of the same kind.  Although they are triggered by the
same super block data anomaly, I divided it into the above two because the
details of the issues and how to fix it are different.

Both are required to eliminate the shift-out-of-bounds issues at mount
time.


This patch (of 2):

If the block size exponent information written in an on-disk superblock is
corrupted, nilfs\_sb2\_bad\_offset helper function can trigger
shift-out-of-bounds warning followed by a kernel panic (if panic\_on\_warn
is set):

 shift exponent 38983 is too large for 64-bit type 'unsigned long long'
 Call Trace:
  \<TASK\>
  \_\_dump\_stack lib/dump\_stack.c:88 \[inline\]
  dump\_stack\_lvl+0x1b1/0x28e lib/dump\_stack.c:106
  ubsan\_epilogue lib/ubsan.c:151 \[inline\]
  \_\_ubsan\_handle\_shift\_out\_of\_bounds+0x33d/0x3b0 lib/ubsan.c:322
  nilfs\_sb2\_bad\_offset fs/nilfs2/the\_nilfs.c:449 \[inline\]
  nilfs\_load\_super\_block+0xdf5/0xe00 fs/nilfs2/the\_nilfs.c:523
  init\_nilfs+0xb7/0x7d0 fs/nilfs2/the\_nilfs.c:577
  nilfs\_fill\_super+0xb1/0x5d0 fs/nilfs2/super.c:1047
  nilfs\_mount+0x613/0x9b0 fs/nilfs2/super.c:1317
  ...

In addition, since nilfs\_sb2\_bad\_offset() performs multiplication without
considering the upper bound, the computation may overflow if the disk
layout parameters are not normal.

This fixes these issues by inserting preliminary sanity checks for those
parameters and by converting the comparison from one involving
multiplication and left bit-shifting to one using division and right
bit-shifting.

## Affected and fixed versions

- Linux: \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 6b0ea3df56cccd53398d0289f399f19d43136b2e; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< a6f89b10042baca218c8598d6db5a44c7e32625f; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 9b3ba54025357440d6c4414c670984f628c6f6bf; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d706485dffbbbf848e681edda29c7a46ac55698c; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d464b035c0613856d012cf1704879d3ff3f057fb; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< b47f5c579c8186f7f5ab5e4254e0734ea5b7bf7a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 1012ff77284e3bec0ec0a35a820b03ec43dec2cc; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 62d11ec205ef14d8acf172cfc9904fdbf200025a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 610a2a3d7d8be3537458a378ec69396a76c385b6 (cvelist)
- Linux: 2.6.30 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-50478.md
Affected: Linux >= e339ad31f59925b48a92ee3947692fdf9758b8c7, < 6b0ea3df56cccd53398d0289f399f19d43136b2e; >= e339ad31f59925b48a92ee3947692fdf9758b8c7, < a6f89b10042baca218c8598d6db5a44c7e32625f; >= e339ad31f59925b48a92ee3947692fdf9758b8c7, < 9b3ba54025357440d6c4414c670984f628c6f6bf; >= e339ad31f59925b48a92ee3…
Fixed in: Linux 6b0ea3df56cccd53398d0289f399f19d43136b2e, Linux 9b3ba54025357440d6c4414c670984f628c6f6bf, Linux 1012ff77284e3bec0ec0a35a820b03ec43dec2cc, Linux 62d11ec205ef14d8acf172cfc9904fdbf200025a, Linux 610a2a3d7d8be3537458a378ec69396a76c385b6

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

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

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

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

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

Linux \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 6b0ea3df56cccd53398d0289f399f19d43136b2e; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< a6f89b10042baca218c8598d6db5a44c7e32625f; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 9b3ba54025357440d6c4414c670984f628c6f6bf; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d706485dffbbbf848e681edda29c7a46ac55698c; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< d464b035c0613856d012cf1704879d3ff3f057fb; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< b47f5c579c8186f7f5ab5e4254e0734ea5b7bf7a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 1012ff77284e3bec0ec0a35a820b03ec43dec2cc; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 62d11ec205ef14d8acf172cfc9904fdbf200025a; \>= e339ad31f59925b48a92ee3947692fdf9758b8c7, \< 610a2a3d7d8be3537458a378ec69396a76c385b6; Linux 2.6.30.

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

Yes. Fixed in Linux 6b0ea3df56cccd53398d0289f399f19d43136b2e, Linux 9b3ba54025357440d6c4414c670984f628c6f6bf, Linux 1012ff77284e3bec0ec0a35a820b03ec43dec2cc, Linux 62d11ec205ef14d8acf172cfc9904fdbf200025a, Linux 610a2a3d7d8be3537458a378ec69396a76c385b6. Upgrade Linux to 610a2a3d7d8be3537458a378ec69396a76c385b6 or later.

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

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/6b0ea3df56cccd53398d0289f399f19d43136b2e>
- patch: <https://git.kernel.org/stable/c/a6f89b10042baca218c8598d6db5a44c7e32625f>
- patch: <https://git.kernel.org/stable/c/9b3ba54025357440d6c4414c670984f628c6f6bf>
- patch: <https://git.kernel.org/stable/c/d706485dffbbbf848e681edda29c7a46ac55698c>
- patch: <https://git.kernel.org/stable/c/d464b035c0613856d012cf1704879d3ff3f057fb>
- patch: <https://git.kernel.org/stable/c/b47f5c579c8186f7f5ab5e4254e0734ea5b7bf7a>
- patch: <https://git.kernel.org/stable/c/1012ff77284e3bec0ec0a35a820b03ec43dec2cc>
- patch: <https://git.kernel.org/stable/c/62d11ec205ef14d8acf172cfc9904fdbf200025a>
- patch: <https://git.kernel.org/stable/c/610a2a3d7d8be3537458a378ec69396a76c385b6>

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

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