diff options
| author | Joseph Qi <joseph.qi@linux.alibaba.com> | 2026-09-01 20:52:20 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-06 19:03:01 -0700 |
| commit | 268fcde8576b96cffa5f57cbdae146d56d1a069d (patch) | |
| tree | 4b58f31889afdde99efab011c0b30e2211f027a0 /scripts/checkstack.pl | |
| parent | e706b89c6a83a52f077e7683e602d992309a5751 (diff) | |
| download | linux-next-268fcde8576b96cffa5f57cbdae146d56d1a069d.tar.gz linux-next-268fcde8576b96cffa5f57cbdae146d56d1a069d.zip | |
ocfs2: validate suballoc slot and bit of xattr and dir index blocks
ocfs2_validate_xattr_block() and ocfs2_validate_dx_root() do not validate
xb_suballoc_slot, xb_suballoc_bit, dr_suballoc_slot and dr_suballoc_bit at
all. Since xattr blocks and dir index root blocks are allocated from a
per-slot suballocator at runtime, their suballoc slots must be within
range and their suballoc bits must fit in a block group bitmap.
Otherwise a corrupted image can carry an out-of-range slot. When the
xattr block or dir index is removed, ocfs2_xattr_block_remove() or
ocfs2_dx_dir_remove_index() passes the unvalidated slot to
ocfs2_get_system_file_inode() and get_local_system_inode() will either hit
BUG_ON(slot == OCFS2_INVALID_SLOT) or compute an out-of-bounds index into
the local_system_inodes array. Similarly an oversized suballoc bit will
error out the filesystem in _ocfs2_free_suballoc_bits().
Furthermore ocfs2_validate_dx_root() does not verify dr_blkno against the
physical block number like the extent and xattr block validators do, so a
misplaced dir index root block can pass validation.
Reject misplaced dir index root blocks, out-of-range suballoc slots and
oversized suballoc bits during validation.
Link: https://lore.kernel.org/20260901125221.1634686-4-joseph.qi@linux.alibaba.com
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Diffstat (limited to 'scripts/checkstack.pl')
0 files changed, 0 insertions, 0 deletions
