{"id":"CVE-2023-53222","state":"PUBLISHED","title":"jfs: jfs_dmap: Validate db_l2nbperpage while mounting","description":"In the Linux kernel, the following vulnerability has been resolved:\n\njfs: jfs_dmap: Validate db_l2nbperpage while mounting\n\nIn jfs_dmap.c at line 381, BLKTODMAP is used to get a logical block\nnumber inside dbFree(). db_l2nbperpage, which is the log2 number of\nblocks per page, is passed as an argument to BLKTODMAP which uses it\nfor shifting.\n\nSyzbot reported a shift out-of-bounds crash because db_l2nbperpage is\ntoo big. This happens because the large value is set without any\nvalidation in dbMount() at line 181.\n\nThus, make sure that db_l2nbperpage is correct while mounting.\n\nMax number of blocks per page = Page size / Min block size\n=> log2(Max num_block per page) = log2(Page size / Min block size)\n\t\t\t\t= log2(Page size) - log2(Min block size)\n\n=> Max db_l2nbperpage = L2PSIZE - L2MINBLOCKSIZE","publishedAt":"2025-09-15T14:21:50.970Z","updatedAt":"2026-08-05T09:13:10.735Z","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":"8c1efe3f74a7864461b0dff281c5562154b4aa8e","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"ef5c205b6e6f8d1f18ef0b4a9832b1b5fa85f7f2","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"a4855aeb13e4ad1f23e16753b68212e180f7d848","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"47b7eaae08e8b2f25bdf37bc14d21be090bcb20f","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"de984faecddb900fa850af4df574a25b32bb93f5","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"c7feb54b113802d2aba98708769d3c33fb017254","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"2a03c4e683d33d17b667418eb717b13dda1fac6b","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"11509910c599cbd04585ec35a6d5e1a0053d84c1","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c","fs/jfs/jfs_filsys.h"]},{"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.14.322","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.291","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.251","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.188","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.121","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.40","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.4.5","status":"unaffected","lessThanOrEqual":"6.4.*","versionType":"semver"},{"version":"6.5","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","fs/jfs/jfs_filsys.h"]}],"references":["https://git.kernel.org/stable/c/8c1efe3f74a7864461b0dff281c5562154b4aa8e","https://git.kernel.org/stable/c/ef5c205b6e6f8d1f18ef0b4a9832b1b5fa85f7f2","https://git.kernel.org/stable/c/a4855aeb13e4ad1f23e16753b68212e180f7d848","https://git.kernel.org/stable/c/47b7eaae08e8b2f25bdf37bc14d21be090bcb20f","https://git.kernel.org/stable/c/de984faecddb900fa850af4df574a25b32bb93f5","https://git.kernel.org/stable/c/c7feb54b113802d2aba98708769d3c33fb017254","https://git.kernel.org/stable/c/2a03c4e683d33d17b667418eb717b13dda1fac6b","https://git.kernel.org/stable/c/11509910c599cbd04585ec35a6d5e1a0053d84c1"],"weaknesses":["CWE-125"],"ingestedAt":"2026-10-29T20:06:33.064Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2023/53xxx/CVE-2023-53222.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2023-53222","state":"PUBLISHED","datePublished":"2025-09-15T14:21:50.970Z","dateUpdated":"2026-08-05T09:13:10.735Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-09-15T14:19:21.845Z"},"containers":{"cna":{"title":"jfs: jfs_dmap: Validate db_l2nbperpage while mounting","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\njfs: jfs_dmap: Validate db_l2nbperpage while mounting\n\nIn jfs_dmap.c at line 381, BLKTODMAP is used to get a logical block\nnumber inside dbFree(). db_l2nbperpage, which is the log2 number of\nblocks per page, is passed as an argument to BLKTODMAP which uses it\nfor shifting.\n\nSyzbot reported a shift out-of-bounds crash because db_l2nbperpage is\ntoo big. This happens because the large value is set without any\nvalidation in dbMount() at line 181.\n\nThus, make sure that db_l2nbperpage is correct while mounting.\n\nMax number of blocks per page = Page size / Min block size\n=> log2(Max num_block per page) = log2(Page size / Min block size)\n\t\t\t\t= log2(Page size) - log2(Min block size)\n\n=> Max db_l2nbperpage = L2PSIZE - L2MINBLOCKSIZE"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"8c1efe3f74a7864461b0dff281c5562154b4aa8e","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"ef5c205b6e6f8d1f18ef0b4a9832b1b5fa85f7f2","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"a4855aeb13e4ad1f23e16753b68212e180f7d848","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"47b7eaae08e8b2f25bdf37bc14d21be090bcb20f","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"de984faecddb900fa850af4df574a25b32bb93f5","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"c7feb54b113802d2aba98708769d3c33fb017254","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"2a03c4e683d33d17b667418eb717b13dda1fac6b","versionType":"git"},{"version":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","status":"affected","lessThan":"11509910c599cbd04585ec35a6d5e1a0053d84c1","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/jfs/jfs_dmap.c","fs/jfs/jfs_filsys.h"]},{"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.14.322","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.291","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.251","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.188","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.121","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.40","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.4.5","status":"unaffected","lessThanOrEqual":"6.4.*","versionType":"semver"},{"version":"6.5","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","fs/jfs/jfs_filsys.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/8c1efe3f74a7864461b0dff281c5562154b4aa8e"},{"url":"https://git.kernel.org/stable/c/ef5c205b6e6f8d1f18ef0b4a9832b1b5fa85f7f2"},{"url":"https://git.kernel.org/stable/c/a4855aeb13e4ad1f23e16753b68212e180f7d848"},{"url":"https://git.kernel.org/stable/c/47b7eaae08e8b2f25bdf37bc14d21be090bcb20f"},{"url":"https://git.kernel.org/stable/c/de984faecddb900fa850af4df574a25b32bb93f5"},{"url":"https://git.kernel.org/stable/c/c7feb54b113802d2aba98708769d3c33fb017254"},{"url":"https://git.kernel.org/stable/c/2a03c4e683d33d17b667418eb717b13dda1fac6b"},{"url":"https://git.kernel.org/stable/c/11509910c599cbd04585ec35a6d5e1a0053d84c1"}],"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 - The bug is reached only after a local mount of an attacker-crafted JFS image on a block/loop device (mount → jfs_fill_super → jfs_mount → dbMount, then later dbFree); there is no network or adjacent-protocol path into fs/jfs.\nAC:L - dn_l2nbperpage is taken verbatim from the on-disk bmap descriptor, so the attacker sets the out-of-range shift amount deterministically; any subsequent free/truncate/umount path that calls BLKTODMAP/dbFree hits the bug with no race or uncontrollable state.\nPR:L - As with sibling JFS crafted-image CVEs, an unprivileged local session user can get the malicious image attached via udisks2/polkit/automount on desktops, kiosks, and shared workstations, then trigger dbFree with ordinary file operations or unmount on that volume.\nUI:N - The attacker supplies the image, causes it to be mounted (including via automount/udisks on their own session), and drives the free/umount path themselves; no separate victim action is required at exploitation time.\nS:U - Wrong metapage selection and allocator/metadata corruption stay inside the kernel’s own memory and security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - An oversized db_l2nbperpage makes BLKTODMAP compute attacker-influenced logical block numbers so dbFree reads the wrong (still attacker-controlled) dmap metapage and walks its summary tree/bitmaps, yielding out-of-bounds reads of adjacent kernel/metapage memory that can be leveraged for disclosure, consistent with other JFS dmap shift-OOB scores.\nI:H - dbFreeDmap/dbFreeBits then write wmap/tree/nfree and in-memory db_agfree[] based on that wrong page and undefined shift results, corrupting heap-backed metapage and bmap state into a write primitive suitable for control-flow hijacking under the higher-severity rule for memory corruption.\nA:H - Syzbot reproduced this as UBSAN shift-out-of-bounds in dbFree (panic under UBSAN_TRAP/panic_on_warn), and the corrupted metapage/allocator paths also produce oopses and jfs_error filesystem shutdown."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T09:13:10.735Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.14.322"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"4.19.291"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.4.251"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.10.188"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.15.121"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.1.40"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.4.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.5"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.1,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2023-53222","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-01-14T17:50:30.557530Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","lang":"en","type":"CWE","description":"CWE-125 Out-of-bounds Read"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-14T17:52:59.269Z"}}]}}}