# CVE-2022-49747: erofs/zmap.c: Fix incorrect offset calculation

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 9% of CVEs (2026-12-01)
- Published: 2025-03-27T16:42:57.094Z
- Modified: 2026-06-17T05:19:02.093Z
- Assigned by: Linux

## Description

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

erofs/zmap.c: Fix incorrect offset calculation

Effective offset to add to length was being incorrectly calculated,
which resulted in iomap->length being set to 0, triggering a WARN_ON
in iomap_iter_done().

Fix that, and describe it in comments.

This was reported as a crash by syzbot under an issue about a warning
encountered in iomap_iter_done(), but unrelated to erofs.

C reproducer: https://syzkaller.appspot.com/text?tag=ReproC&x=1037a6b2880000
Kernel config: https://syzkaller.appspot.com/text?tag=KernelConfig&x=e2021a61197ebe02
Dashboard link: https://syzkaller.appspot.com/bug?extid=a8e049cd3abd342936b6

(As written by CVE List.)

## Affected

- Linux Linux: from eadcd6b5a1eb39866ab8d8a3e4f2e51bc51a2350 before 2144859229c1e74f52d3ea067338d314a83a8afb; from eadcd6b5a1eb39866ab8d8a3e4f2e51bc51a2350 before 9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c; from eadcd6b5a1eb39866ab8d8a3e4f2e51bc51a2350 before 6acd87d50998ef0afafc441613aeaf5a8f5c9eff; 5.15 (not affected: before 5.15; from 5.15.92 up to 5.15.*; from 6.1.10 up to 6.1.*; from 6.2 up to *)
- linux linux_kernel: from 5.15 before 5.15.92; from 5.16 before 6.1.10; 6.2

## References

- <https://git.kernel.org/stable/c/2144859229c1e74f52d3ea067338d314a83a8afb> (patch)
- <https://git.kernel.org/stable/c/9f31d8c889d9a4e47bfcc6c4537d0c9f89fe582c> (patch)
- <https://git.kernel.org/stable/c/6acd87d50998ef0afafc441613aeaf5a8f5c9eff> (patch)

## Sources

- CVE List: [CVE-2022-49747](https://www.cve.org/CVERecord?id=CVE-2022-49747), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2022-49747](https://nvd.nist.gov/vuln/detail/CVE-2022-49747), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-49747 · Whole record: https://cve.day/CVE-2022-49747.json · Rebuilt by cve.day 2026-11-25T22:58:20.843Z
