{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38710","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T04:51:24.033Z","datePublished":"2025-09-04T15:33:00.629Z","dateUpdated":"2026-08-05T12:04:10.498Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:04:10.498Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ngfs2: Validate i_depth for exhash directories\n\nA fuzzer test introduced corruption that ends up with a depth of 0 in\ndir_e_read(), causing an undefined shift by 32 at:\n\n  index = hash >> (32 - dip->i_depth);\n\nAs calculated in an open-coded way in dir_make_exhash(), the minimum\ndepth for an exhash directory is ilog2(sdp->sd_hash_ptrs) and 0 is\ninvalid as sdp->sd_hash_ptrs is fixed as sdp->bsize / 16 at mount time.\n\nSo we can avoid the undefined behaviour by checking for depth values\nlower than the minimum in gfs2_dinode_in(). Values greater than the\nmaximum are already being checked for there.\n\nAlso switch the calculation in dir_make_exhash() to use ilog2() to\nclarify how the depth is calculated.\n\nTested with the syzkaller repro.c and xfstests '-g quick'."}],"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 corrupt `di_depth` reaches the kernel only by mounting an attacker-crafted GFS2 volume (loop device, removable media, or a shared cluster LUN), after which the flaw is triggered by ordinary local syscalls (`open`/`stat`/`getdents`) on that mount. GFS2 is a shared-disk filesystem with no network-protocol front end, so there is no remote parser path.\nAC:L - The condition is a deterministic inconsistency the attacker fully authors on disk (`GFS2_DIF_EXHASH` set, `di_depth = 0`, `di_size = 8`), and the out-of-bounds index is chosen exactly by picking a filename whose CRC32 hash equals the desired 32-bit offset. No race, no timing window, and no memory-layout condition outside the attacker's control.\nPR:L - The bare `mount(2)` needs CAP_SYS_ADMIN (gfs2 lacks FS_USERNS_MOUNT), but in the most severe reasonable deployment an unprivileged user gets the crafted volume mounted through udisks2 loop-setup/removable-media automount or `user`/autofs fstab delegation, and the trigger itself — a path lookup or `getdents` on the bad directory — requires only basic unprivileged access to the mount.\nUI:N - In the automount/loop-setup scenario the attacker presents the media and initiates the mount themselves, and at the point of exploitation the out-of-bounds read fires from the attacker's own `open()`/`stat()` call. No second user has to take any action.\nS:U - The out-of-bounds access, the wild block read, and the hang all occur in GFS2 code inside the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - `get_leaf_nr()` reads a 64-bit word at `hash + 8*index` where `index` is a fully attacker-chosen 32-bit value and the allocation is 8 bytes — an unbounded slab out-of-bounds read reaching up to 32 GiB past the object, far beyond a \"few bytes\" bounded read. The value read becomes a block number handed to `gfs2_meta_read()`, giving an observable oracle on kernel heap contents through lookup success/failure and the resulting I/O.\nI:H - Out-of-bounds heap data is promoted to a filesystem block number, and `dir_new_leaf()`/`gfs2_dir_add()` then write directory metadata (`oleaf->lf_next`, `be16_add_cpu(&leaf->lf_entries, 1)`) into the buffer for that attacker-influenced block, so kernel-side data read past the object's bounds steers subsequent metadata writes to arbitrary blocks of the device — including a shared cluster LUN.\nA:H - A read up to 32 GiB past an 8-byte slab object will typically strike unmapped memory and produce a kernel oops/page fault (KASAN reports it as slab-out-of-bounds), and `dir_e_read()` independently spins forever because `len` truncates to 0 so `index` never advances, wedging `getdents()` while holding the directory glock and stalling the mount — a full panic on `panic_on_oops` configurations, repeatable on demand."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/gfs2/dir.c","fs/gfs2/glops.c"],"versions":[{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"076e992752e4b24178918f748d75597c80a408d2","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"366183911b153e9b8cf758e1414e1154d7569337","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"112bb60cd0e254a369e95aa9941a694ffeca089f","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"cddea0c721106ea480371412d8de21705eb27376","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"53a0249d68a210c16e961b83adfa82f94ee0a53d","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"b5f46951e62377b6e406fadc18bc3c5bdf1632a7","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"9680c58675b82348ab84d387e4fa727f7587e1a0","status":"affected","versionType":"git"},{"version":"9a0045088d888c9c539c8c626a366cb52c0fbdab","lessThan":"557c024ca7250bb65ae60f16c02074106c2f197b","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/gfs2/dir.c","fs/gfs2/glops.c"],"versions":[{"version":"2.6.26","status":"affected"},{"version":"0","lessThan":"2.6.26","status":"unaffected","versionType":"semver"},{"version":"5.10.258","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.209","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.175","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.134","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.43","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.15.11","lessThanOrEqual":"6.15.*","status":"unaffected","versionType":"semver"},{"version":"6.16.2","lessThanOrEqual":"6.16.*","status":"unaffected","versionType":"semver"},{"version":"6.17","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"5.10.258"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"5.15.209"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.1.175"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.6.134"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.12.43"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.15.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.16.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.26","versionEndExcluding":"6.17"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/076e992752e4b24178918f748d75597c80a408d2"},{"url":"https://git.kernel.org/stable/c/366183911b153e9b8cf758e1414e1154d7569337"},{"url":"https://git.kernel.org/stable/c/112bb60cd0e254a369e95aa9941a694ffeca089f"},{"url":"https://git.kernel.org/stable/c/cddea0c721106ea480371412d8de21705eb27376"},{"url":"https://git.kernel.org/stable/c/53a0249d68a210c16e961b83adfa82f94ee0a53d"},{"url":"https://git.kernel.org/stable/c/b5f46951e62377b6e406fadc18bc3c5bdf1632a7"},{"url":"https://git.kernel.org/stable/c/9680c58675b82348ab84d387e4fa727f7587e1a0"},{"url":"https://git.kernel.org/stable/c/557c024ca7250bb65ae60f16c02074106c2f197b"}],"title":"gfs2: Validate i_depth for exhash directories","x_generator":{"engine":"bippy-1.2.0"}}}}