{"id":"CVE-2022-50567","state":"PUBLISHED","title":"fs: jfs: fix shift-out-of-bounds in dbAllocAG","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: jfs: fix shift-out-of-bounds in dbAllocAG\n\nSyzbot found a crash : UBSAN: shift-out-of-bounds in dbAllocAG. The\nunderlying bug is the missing check of bmp->db_agl2size. The field can\nbe greater than 64 and trigger the shift-out-of-bounds.\n\nFix this bug by adding a check of bmp->db_agl2size in dbMount since this\nfield is used in many following functions. The upper bound for this\nfield is L2MAXL2SIZE - L2MAXAG, thanks for the help of Dave Kleikamp.\nNote that, for maintenance, I reorganized error handling code of dbMount.","publishedAt":"2025-10-22T13:23:24.508Z","updatedAt":"2026-08-05T08:59:08.386Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"d3b486946a4e62c7ef6023f7d9c1d049051384ba","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3115313cf03113e87c87adee18ee49a20bbdb9ba","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"eea87acb6027be3dd4d3c57186bb22800d57fdda","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"359616ce587e524107730504891afa4b1a8be58c","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3e997e4ce8ae7ab89d72334120f6aee49c5bbdbd","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"0536f76a2bca83d1a3740517ba22cc93a44b3099","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"2c575c8905f7a8b32d5611b91856b69bac2a5bf1","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"67973caae78e21ee46a7281aaa8ca364eb9c444f","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"898f706695682b9954f280d95e49fa86ffa55d08","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"4.9.337","status":"unaffected","lessThanOrEqual":"4.9.*","versionType":"semver"},{"version":"4.14.303","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.270","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.229","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.163","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.86","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c"]}],"references":["https://git.kernel.org/stable/c/d3b486946a4e62c7ef6023f7d9c1d049051384ba","https://git.kernel.org/stable/c/3115313cf03113e87c87adee18ee49a20bbdb9ba","https://git.kernel.org/stable/c/eea87acb6027be3dd4d3c57186bb22800d57fdda","https://git.kernel.org/stable/c/359616ce587e524107730504891afa4b1a8be58c","https://git.kernel.org/stable/c/3e997e4ce8ae7ab89d72334120f6aee49c5bbdbd","https://git.kernel.org/stable/c/0536f76a2bca83d1a3740517ba22cc93a44b3099","https://git.kernel.org/stable/c/2c575c8905f7a8b32d5611b91856b69bac2a5bf1","https://git.kernel.org/stable/c/67973caae78e21ee46a7281aaa8ca364eb9c444f","https://git.kernel.org/stable/c/898f706695682b9954f280d95e49fa86ffa55d08"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50567.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50567","state":"PUBLISHED","datePublished":"2025-10-22T13:23:24.508Z","dateUpdated":"2026-08-05T08:59:08.386Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-10-22T13:20:23.760Z"},"containers":{"cna":{"title":"fs: jfs: fix shift-out-of-bounds in dbAllocAG","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: jfs: fix shift-out-of-bounds in dbAllocAG\n\nSyzbot found a crash : UBSAN: shift-out-of-bounds in dbAllocAG. The\nunderlying bug is the missing check of bmp->db_agl2size. The field can\nbe greater than 64 and trigger the shift-out-of-bounds.\n\nFix this bug by adding a check of bmp->db_agl2size in dbMount since this\nfield is used in many following functions. The upper bound for this\nfield is L2MAXL2SIZE - L2MAXAG, thanks for the help of Dave Kleikamp.\nNote that, for maintenance, I reorganized error handling code of dbMount."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"d3b486946a4e62c7ef6023f7d9c1d049051384ba","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3115313cf03113e87c87adee18ee49a20bbdb9ba","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"eea87acb6027be3dd4d3c57186bb22800d57fdda","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"359616ce587e524107730504891afa4b1a8be58c","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"3e997e4ce8ae7ab89d72334120f6aee49c5bbdbd","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"0536f76a2bca83d1a3740517ba22cc93a44b3099","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"2c575c8905f7a8b32d5611b91856b69bac2a5bf1","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"67973caae78e21ee46a7281aaa8ca364eb9c444f","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"898f706695682b9954f280d95e49fa86ffa55d08","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"4.9.337","status":"unaffected","lessThanOrEqual":"4.9.*","versionType":"semver"},{"version":"4.14.303","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.270","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.229","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.163","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.86","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.16","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.2","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/d3b486946a4e62c7ef6023f7d9c1d049051384ba"},{"url":"https://git.kernel.org/stable/c/3115313cf03113e87c87adee18ee49a20bbdb9ba"},{"url":"https://git.kernel.org/stable/c/eea87acb6027be3dd4d3c57186bb22800d57fdda"},{"url":"https://git.kernel.org/stable/c/359616ce587e524107730504891afa4b1a8be58c"},{"url":"https://git.kernel.org/stable/c/3e997e4ce8ae7ab89d72334120f6aee49c5bbdbd"},{"url":"https://git.kernel.org/stable/c/0536f76a2bca83d1a3740517ba22cc93a44b3099"},{"url":"https://git.kernel.org/stable/c/2c575c8905f7a8b32d5611b91856b69bac2a5bf1"},{"url":"https://git.kernel.org/stable/c/67973caae78e21ee46a7281aaa8ca364eb9c444f"},{"url":"https://git.kernel.org/stable/c/898f706695682b9954f280d95e49fa86ffa55d08"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Reachable only after mounting a crafted JFS block/loop image, then ordinary local syscalls (mkdir → jfs_mkdir → ialloc → diAlloc → dbAlloc → dbAllocAG); fs/jfs has no network or adjacent-protocol entry point.\nAC:L - dn_agl2size is taken verbatim from attacker-controlled on-disk bmap metadata into bmp->db_agl2size, so the oversized shift in dbAllocAG (syzbot exponent 8345714) is deterministic with no race or attacker-uncontrollable state.\nPR:L - As with sibling JFS crafted-image CVEs, an unprivileged desktop/kiosk session user can attach the malicious image via udisks2/polkit/automount and then trigger dbAllocAG with ordinary mkdir; JFS lacks FS_USERNS_MOUNT but realistic low-privilege mount helpers still apply.\nUI:N - The attacker supplies the image, causes it to be mounted in their own session (including via automount/udisks), and drives mkdir themselves; no separate victim action is required at exploitation time.\nS:U - Wrong block-number computation and subsequent metapage/allocator corruption stay inside the host kernel’s security authority and do not cross a VM, IOMMU, or other separate boundary.\nC:H - An oversized db_agl2size makes the AG-start shift and later >> uses produce attacker-influenced block numbers so dbAllocAG/dbAlloc read wrong (attacker-controlled) dmapctl/dmap metapages and walk their trees/bitmaps, enabling disclosure consistent with other JFS dmap shift-OOB scores.\nI:H - Those wrong blkno/agno values then drive writes through dbAllocCtl/dbAllocBits into wmap/tree/nfree and in-memory db_agfree[] on heap-backed metapage/bmap state, yielding a write primitive suitable for control-flow hijacking under the higher-severity rule for memory corruption.\nA:H - Syzbot reported UBSAN shift-out-of-bounds in dbAllocAG (panic under UBSAN_TRAP/panic_on_warn), and the corrupted metapage/allocator paths also produce kernel oopses and jfs_error filesystem shutdown."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:59:08.386Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.9.337"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.14.303"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.19.270"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.4.229"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.10.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.15.86"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.0.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.1.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}