{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2022-49007","id":"CVE-2022-49007","title":"nilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry()\n\nSyzbot reported a null-ptr-deref bug:\n\n NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP\n frequency < 30 seconds\n general protection fault, probably for non-canonical address\n 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN\n KASAN: nu","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nnilfs2: fix NULL pointer dereference in nilfs_palloc_commit_free_entry()\n\nSyzbot reported a null-ptr-deref bug:\n\n NILFS (loop0): segctord starting. Construction interval = 5 seconds, CP\n frequency < 30 seconds\n general protection fault, probably for non-canonical address\n 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN\n KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]\n CPU: 1 PID: 3603 Comm: segctord Not tainted\n 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0\n Hardware name: Google Compute Engine/Google Compute Engine, BIOS Google\n 10/11/2022\n RIP: 0010:nilfs_palloc_commit_free_entry+0xe5/0x6b0\n fs/nilfs2/alloc.c:608\n Code: 00 00 00 00 fc ff df 80 3c 02 00 0f 85 cd 05 00 00 48 b8 00 00 00\n 00 00 fc ff df 4c 8b 73 08 49 8d 7e 10 48 89 fa 48 c1 ea 03 <80> 3c 02\n 00 0f 85 26 05 00 00 49 8b 46 10 be a6 00 00 00 48 c7 c7\n RSP: 0018:ffffc90003dff830 EFLAGS: 00010212\n RAX: dffffc0000000000 RBX: ffff88802594e218 RCX: 000000000000000d\n RDX: 0000000000000002 RSI: 0000000000002000 RDI: 0000000000000010\n RBP: ffff888071880222 R08: 0000000000000005 R09: 000000000000003f\n R10: 000000000000000d R11: 0000000000000000 R12: ffff888071880158\n R13: ffff88802594e220 R14: 0000000000000000 R15: 0000000000000004\n FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000)\n knlGS:0000000000000000\n CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n CR2: 00007fb1c08316a8 CR3: 0000000018560000 CR4: 0000000000350ee0\n Call Trace:\n  <TASK>\n  nilfs_dat_commit_free fs/nilfs2/dat.c:114 [inline]\n  nilfs_dat_commit_end+0x464/0x5f0 fs/nilfs2/dat.c:193\n  nilfs_dat_commit_update+0x26/0x40 fs/nilfs2/dat.c:236\n  nilfs_btree_commit_update_v+0x87/0x4a0 fs/nilfs2/btree.c:1940\n  nilfs_btree_commit_propagate_v fs/nilfs2/btree.c:2016 [inline]\n  nilfs_btree_propagate_v fs/nilfs2/btree.c:2046 [inline]\n  nilfs_btree_propagate+0xa00/0xd60 fs/nilfs2/btree.c:2088\n  nilfs_bmap_propagate+0x73/0x170 fs/nilfs2/bmap.c:337\n  nilfs_collect_file_data+0x45/0xd0 fs/nilfs2/segment.c:568\n  nilfs_segctor_apply_buffers+0x14a/0x470 fs/nilfs2/segment.c:1018\n  nilfs_segctor_scan_file+0x3f4/0x6f0 fs/nilfs2/segment.c:1067\n  nilfs_segctor_collect_blocks fs/nilfs2/segment.c:1197 [inline]\n  nilfs_segctor_collect fs/nilfs2/segment.c:1503 [inline]\n  nilfs_segctor_do_construct+0x12fc/0x6af0 fs/nilfs2/segment.c:2045\n  nilfs_segctor_construct+0x8e3/0xb30 fs/nilfs2/segment.c:2379\n  nilfs_segctor_thread_construct fs/nilfs2/segment.c:2487 [inline]\n  nilfs_segctor_thread+0x3c3/0xf30 fs/nilfs2/segment.c:2570\n  kthread+0x2e4/0x3a0 kernel/kthread.c:376\n  ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306\n  </TASK>\n ...\n\nIf DAT metadata file is corrupted on disk, there is a case where\nreq->pr_desc_bh is NULL and blocknr is 0 at nilfs_dat_commit_end() during\na b-tree operation that cascadingly updates ancestor nodes of the b-tree,\nbecause nilfs_dat_commit_alloc() for a lower level block can initialize\nthe blocknr on the same DAT entry between nilfs_dat_prepare_end() and\nnilfs_dat_commit_end().\n\nIf this happens, nilfs_dat_commit_end() calls nilfs_dat_commit_free()\nwithout valid buffer heads in req->pr_desc_bh and req->pr_bitmap_bh, and\ncauses the NULL pointer dereference above in\nnilfs_palloc_commit_free_entry() function, which leads to a crash.\n\nFix this by adding a NULL check on req->pr_desc_bh and req->pr_bitmap_bh\nbefore nilfs_palloc_commit_free_entry() in nilfs_dat_commit_free().\n\nThis also calls nilfs_error() in that case to notify that there is a fatal\nflaw in the filesystem metadata and prevent further operations.","published":"2024-10-21T20:06:19.506Z","updated":"2026-10-28T02:30:26.082210901Z","reserved":"2024-08-22T01:27:53.643Z","status":"Analyzed","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"},"metrics":[{"version":"3.1","score":5.5,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"NVD"}],"rating":"medium","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"2f2c59506ae39496588ceb8b88bdbdbaed895d63","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"165c7a3b27a3857ebf57f626b9f38b48b6792e68","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"bc3fd3293887b4cf84a9109700faeb82de533c89","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"9a130b72e6bd1fb07fc3cde839dc6fb53da76f07","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"e858917ab785afe83c14f5ac141301216ccda847","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"33021419fd81efd3d729a7f19341ba4b98fe66ce","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"381b84f60e549ea98cec4666c6c728b1b3318756","status":"affected","versionType":"git"},{"version":"a17564f58b11476c011d623fa1f268602a81c27c","lessThan":"f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.30","status":"affected"},{"version":"0","lessThan":"2.6.30","status":"unaffected","versionType":"semver"},{"version":"4.9.335","lessThanOrEqual":"4.9.*","status":"unaffected","versionType":"semver"},{"version":"4.14.301","lessThanOrEqual":"4.14.*","status":"unaffected","versionType":"semver"},{"version":"4.19.268","lessThanOrEqual":"4.19.*","status":"unaffected","versionType":"semver"},{"version":"5.4.226","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.158","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.82","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.0.12","lessThanOrEqual":"6.0.*","status":"unaffected","versionType":"semver"},{"version":"6.1","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-476"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/2f2c59506ae39496588ceb8b88bdbdbaed895d63","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/165c7a3b27a3857ebf57f626b9f38b48b6792e68","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/bc3fd3293887b4cf84a9109700faeb82de533c89","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/9a130b72e6bd1fb07fc3cde839dc6fb53da76f07","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/e858917ab785afe83c14f5ac141301216ccda847","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/33021419fd81efd3d729a7f19341ba4b98fe66ce","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/381b84f60e549ea98cec4666c6c728b1b3318756","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/f0a0ccda18d6fd826d7c7e7ad48a6ed61c20f8b4","tags":["Patch","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49007.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49007","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00249,"epssPercentile":0.16332,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2022-49007","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49007","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2022-49007","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2022-49007","ok":true,"note":"scored 2026-11-18"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}