{"id":"CVE-2022-50333","state":"PUBLISHED","title":"fs: jfs: fix shift-out-of-bounds in dbDiscardAG","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: jfs: fix shift-out-of-bounds in dbDiscardAG\n\nThis should be applied to most URSAN bugs found recently by syzbot,\nby guarding the dbMount. As syzbot feeding rubbish into the bmap\ndescriptor.","publishedAt":"2025-09-15T14:49:46.222Z","updatedAt":"2026-08-05T08:58:15.308Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"f8d4d0bac603616e2fa4a3907e81ed13f8f3c380","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"0183c8f46ab5bcd0740f41c87f5141c6ca2bf1bb","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"624843f1bac448150f6859999c72c4841c14a2e3","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"50163a115831ef4e6402db5a7ef487d1989d7249","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"911999b193735cd378517b6cd5fe585ee345d49c","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"10b87da8fae79c7daf5eda6a9e4f1d31b85b4d92","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"ab5cd3d62c2493eca3337e7d0178cc7bd819ca64","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"3d340b684dcec5e34efc470227cd1c7d2df121ad","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"25e70c6162f207828dd405b432d8f2a98dbf7082","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":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","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/f8d4d0bac603616e2fa4a3907e81ed13f8f3c380","https://git.kernel.org/stable/c/0183c8f46ab5bcd0740f41c87f5141c6ca2bf1bb","https://git.kernel.org/stable/c/624843f1bac448150f6859999c72c4841c14a2e3","https://git.kernel.org/stable/c/50163a115831ef4e6402db5a7ef487d1989d7249","https://git.kernel.org/stable/c/911999b193735cd378517b6cd5fe585ee345d49c","https://git.kernel.org/stable/c/10b87da8fae79c7daf5eda6a9e4f1d31b85b4d92","https://git.kernel.org/stable/c/ab5cd3d62c2493eca3337e7d0178cc7bd819ca64","https://git.kernel.org/stable/c/3d340b684dcec5e34efc470227cd1c7d2df121ad","https://git.kernel.org/stable/c/25e70c6162f207828dd405b432d8f2a98dbf7082"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50333.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50333","state":"PUBLISHED","datePublished":"2025-09-15T14:49:46.222Z","dateUpdated":"2026-08-05T08:58:15.308Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-09-15T14:18:36.816Z"},"containers":{"cna":{"title":"fs: jfs: fix shift-out-of-bounds in dbDiscardAG","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs: jfs: fix shift-out-of-bounds in dbDiscardAG\n\nThis should be applied to most URSAN bugs found recently by syzbot,\nby guarding the dbMount. As syzbot feeding rubbish into the bmap\ndescriptor."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"f8d4d0bac603616e2fa4a3907e81ed13f8f3c380","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"0183c8f46ab5bcd0740f41c87f5141c6ca2bf1bb","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"624843f1bac448150f6859999c72c4841c14a2e3","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"50163a115831ef4e6402db5a7ef487d1989d7249","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"911999b193735cd378517b6cd5fe585ee345d49c","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"10b87da8fae79c7daf5eda6a9e4f1d31b85b4d92","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"ab5cd3d62c2493eca3337e7d0178cc7bd819ca64","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"3d340b684dcec5e34efc470227cd1c7d2df121ad","versionType":"git"},{"version":"b40c2e665cd552eae5fbdbb878bc29a34357668e","status":"affected","lessThan":"25e70c6162f207828dd405b432d8f2a98dbf7082","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":"3.7","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.7","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/f8d4d0bac603616e2fa4a3907e81ed13f8f3c380"},{"url":"https://git.kernel.org/stable/c/0183c8f46ab5bcd0740f41c87f5141c6ca2bf1bb"},{"url":"https://git.kernel.org/stable/c/624843f1bac448150f6859999c72c4841c14a2e3"},{"url":"https://git.kernel.org/stable/c/50163a115831ef4e6402db5a7ef487d1989d7249"},{"url":"https://git.kernel.org/stable/c/911999b193735cd378517b6cd5fe585ee345d49c"},{"url":"https://git.kernel.org/stable/c/10b87da8fae79c7daf5eda6a9e4f1d31b85b4d92"},{"url":"https://git.kernel.org/stable/c/ab5cd3d62c2493eca3337e7d0178cc7bd819ca64"},{"url":"https://git.kernel.org/stable/c/3d340b684dcec5e34efc470227cd1c7d2df121ad"},{"url":"https://git.kernel.org/stable/c/25e70c6162f207828dd405b432d8f2a98dbf7082"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached only by mounting a crafted JFS block device/image so dbMount loads attacker-controlled bmap fields; there is no network or adjacent-protocol entry into fs/jfs.\nAC:L - A malicious on-disk bmap with (mapsize-1)>>agl2size > MAXAG deterministically yields out-of-range AG indices and triggers OOB db_agfree access / shift UB on FITRIM or allocation; the attacker fully controls that layout with no race.\nPR:N - The attacker needs no account on the target—only a malicious JFS image (USB stick, disk/container image, or media presented to udisks2/automount on desktops, kiosks, or embedded systems).\nUI:R - jfs is FS_REQUIRES_DEV without FS_USERNS_MOUNT, so CAP_SYS_ADMIN is required to mount; a victim or automount daemon must mount the attacker-supplied volume before the OOB path runs.\nS:U - Impact is host-kernel heap OOB on the in-memory bmap descriptor under the same OS security authority; it is not a VM escape, IOMMU bypass, or sandbox boundary crossing.\nC:H - Invalid AG counts cause out-of-bounds reads of bmp->db_agfree[agno] (and related AG state) past MAXAG; per guidance OOB reads are Confidentiality High.\nI:H - Allocation/free paths perform bmp->db_agfree[agno] -= / += nblocks with attacker-influenced agno, corrupting adjacent bmap heap fields and enabling write/control-flow primitives; OOB write is Integrity High.\nA:H - The demonstrated UBSAN shift-out-of-bounds in dbDiscardAG and OOB AG indexing can oops/panic the kernel, so availability impact is High."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:58:15.308Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"4.9.337"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"4.14.303"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"4.19.270"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.4.229"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.10.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"5.15.86"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.0.16"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.1.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.7","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}