diff options
| author | Leo Stone <[email protected]> | 2024-12-01 05:14:19 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2024-12-02 14:32:19 +0000 |
| commit | b905bafdea21a75d75a96855edd9e0b6051eee30 (patch) | |
| tree | 86812751233eed063db6e26a104bd00f84b1be2b /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | Linux 6.13-rc1 (diff) | |
| download | kernel-b905bafdea21a75d75a96855edd9e0b6051eee30.tar.gz kernel-b905bafdea21a75d75a96855edd9e0b6051eee30.zip | |
hfs: Sanity check the root record
In the syzbot reproducer, the hfs_cat_rec for the root dir has type
HFS_CDR_FIL after being read with hfs_bnode_read() in hfs_super_fill().
This indicates it should be used as an hfs_cat_file, which is 102 bytes.
Only the first 70 bytes of that struct are initialized, however,
because the entrylength passed into hfs_bnode_read() is still the length of
a directory record. This causes uninitialized values to be used later on,
when the hfs_cat_rec union is treated as the larger hfs_cat_file struct.
Add a check to make sure the retrieved record has the correct type
for the root directory (HFS_CDR_DIR), and make sure we load the correct
number of bytes for a directory record.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=2db3c7526ba68f4ea776
Tested-by: [email protected]
Tested-by: Leo Stone <[email protected]>
Signed-off-by: Leo Stone <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
0 files changed, 0 insertions, 0 deletions
