]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/xfs: Fix issues found while fuzzing the XFS filesystem
authorDarren Kenny <darren.kenny@oracle.com>
Fri, 2 Jun 2023 18:08:44 +0000 (18:08 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 13 Jun 2023 12:26:47 +0000 (14:26 +0200)
commitef7850c757fb3dd2462a512cfa0ff19c89fcc0b1
tree2ea2ffafd45f15b08079e302eea89c12de778508
parent4ffe6391ca150c19dd6626dee3a82e86541b531f
fs/xfs: Fix issues found while fuzzing the XFS filesystem

While performing fuzz testing with XFS filesystem images with ASAN
enabled, several issues were found where the memory accesses are made
beyond the data that is allocated into the struct grub_xfs_data
structure's data field.

The existing structure didn't store the size of the memory allocated into
the buffer in the data field and had no way to check it. To resolve these
issues, the data size is stored to enable checks into the data buffer.

With these checks in place, the fuzzing corpus no longer cause any crashes.

Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
Signed-off-by: Marta Lewandowska <mlewando@redhat.com>
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/xfs.c