DF-3065
ext2_reallocblks feeds unclamped attacker-controlled pref (crafted i_db[]/indirect values via ext2_blkpref) into dtog() as the cg index — OOB heap reads of e2fs_gd[]/e2fs_maxcluster[]/e2fs_clustersum[] and wild device I/O (root-sysctl-gated)
Summary
ext2_blkpref returns raw le32toh(bap[tmp]) values from crafted on-disk block maps (:710-712). Every other consumer funnels them through ext2_alloc's 'bpref >= bcount -> 0' clamp (:130), but ext2_reallocblks:302 calls ext2_hashalloc(ip, dtog(fs, pref), pref, ...) directly: pref up to 0xFFFFFFFF gives cg up to ~524287, far beyond gcount, indexing fs->e2fs_maxcluster[cg] (:1146), fs->e2fs_gd[cg] (:1151) and fs->e2fs_clustersum[cg] out of bounds - wild kernel heap reads whose results then steer bread/bdwrite device offsets. Gated behind vfs.ext2fs.doreallocblks != 0 (default 0, root-writable sysctl) and contigsumsize > 0, hence Low. Verification skipped (privileged-configuration gate). Fix: clamp pref >= bcount -> 0 (mirroring :130).
No comments yet.