summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-06-29 20:15:45 +0300
committerDarrick J. Wong <djwong@kernel.org>2023-07-03 19:48:17 +0300
commit2d7d1e7ea321b0b2810eb00183e21332ee9c4b6f (patch)
treee00f7799bc0b522fc99e9d3371d0e9f5d83c5475 /io_uring
parent5cf32f63b0f4c520460c1a5dd915dc4f09085f29 (diff)
downloadlinux-2d7d1e7ea321b0b2810eb00183e21332ee9c4b6f.tar.xz
xfs: AGI length should be bounds checked
Similar to the recent patch strengthening the AGF agf_length verification, the AGI verifier does not check that the AGI length field is within known good bounds. This isn't currently checked by runtime kernel code, yet we assume in many places that it is correct and verify other metadata against it. Add length verification to the AGI verifier. Just like the AGF length checking, the length of the AGI must be equal to the size of the AG specified in the superblock, unless it is the last AG in the filesystem. In that case, it must be less than or equal to sb->sb_agblocks and greater than XFS_MIN_AG_BLOCKS, which is the smallest AG a growfs operation will allow to exist. There's only one place in the filesystem that actually uses agi_length, but let's not leave it vulnerable to the same weird nonsense that generates syzbot bugs, eh? Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'io_uring')
0 files changed, 0 insertions, 0 deletions