CVE-2022-49738

Source
https://cve.org/CVERecord?id=CVE-2022-49738
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49738.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-49738
Downstream
Published
2025-03-27T16:42:50.951Z
Modified
2026-07-15T01:49:09.686740555Z
Severity
  • 7.1 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H CVSS Calculator
Summary
f2fs: fix to do sanity check on i_extra_isize in is_alive()
Details

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

f2fs: fix to do sanity check on iextraisize in is_alive()

syzbot found a f2fs bug:

BUG: KASAN: slab-out-of-bounds in datablkaddr fs/f2fs/f2fs.h:2891 [inline] BUG: KASAN: slab-out-of-bounds in isalive fs/f2fs/gc.c:1117 [inline] BUG: KASAN: slab-out-of-bounds in gcdatasegment fs/f2fs/gc.c:1520 [inline] BUG: KASAN: slab-out-of-bounds in dogarbagecollect+0x386a/0x3df0 fs/f2fs/gc.c:1734 Read of size 4 at addr ffff888076557568 by task kworker/u4:3/52

CPU: 1 PID: 52 Comm: kworker/u4:3 Not tainted 6.1.0-rc4-syzkaller-00362-gfef7fd48922d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: <TASK> __dumpstack lib/dumpstack.c:88 [inline] dumpstacklvl+0xcd/0x134 lib/dumpstack.c:106 printaddressdescription mm/kasan/report.c:284 [inline] printreport+0x15e/0x45d mm/kasan/report.c:395 kasanreport+0xbb/0x1f0 mm/kasan/report.c:495 datablkaddr fs/f2fs/f2fs.h:2891 [inline] isalive fs/f2fs/gc.c:1117 [inline] gcdatasegment fs/f2fs/gc.c:1520 [inline] dogarbagecollect+0x386a/0x3df0 fs/f2fs/gc.c:1734 f2fsgc+0x88c/0x20a0 fs/f2fs/gc.c:1831 f2fsbalancefs+0x544/0x6b0 fs/f2fs/segment.c:410 f2fswriteinode+0x57e/0xe20 fs/f2fs/inode.c:753 write_inode fs/fs-writeback.c:1440 [inline] __writebacksingleinode+0xcfc/0x1440 fs/fs-writeback.c:1652 writebacksbinodes+0x54d/0xf90 fs/fs-writeback.c:1870 wbwriteback+0x2c5/0xd70 fs/fs-writeback.c:2044 wbdowriteback fs/fs-writeback.c:2187 [inline] wbworkfn+0x2dc/0x12f0 fs/fs-writeback.c:2227 processonework+0x9bf/0x1710 kernel/workqueue.c:2289 workerthread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 retfromfork+0x1f/0x30 arch/x86/entry/entry64.S:306

The root cause is that we forgot to do sanity check on .iextraisize in below path, result in accessing invalid address later, fix it. - gcdatasegment - isalive - datablkaddr - offsetinaddr

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49738.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
98e4da8ca301e062d79ae168c67e56f3c3de3ce4
Fixed
e5142a4935c1f15841d06047b8130078fc4d7b8f
Fixed
914e38f02a490dafd980ff0f39cccedc074deb29
Fixed
97ccfffcc061e54ce87e4a51a40e2e9cb0b7076a
Fixed
5b25035fb888cb2f78bf0b9c9f95b1dc54480d36
Fixed
d3b7b4afd6b2c344eabf9cc26b8bfa903c164c7c

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49738.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.8.0
Fixed
5.4.232
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.168
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.93
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.11

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49738.json"