diff options
| author | Leo Stone <leocstone@gmail.com> | 2024-11-30 21:14:19 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-01-23 17:22:54 +0100 |
| commit | 709dfdd7e5cacfa98a0911139bfcfe5cb8bb5c61 (patch) | |
| tree | 08a4e9bec2da6aa5228e10a7ff1cd1efe06be9fa /scripts/git.orderFile | |
| parent | b856d2c1384bc5a7456262afd21aa439ee5cdf6e (diff) | |
| download | linux-709dfdd7e5cacfa98a0911139bfcfe5cb8bb5c61.tar.gz linux-709dfdd7e5cacfa98a0911139bfcfe5cb8bb5c61.tar.bz2 linux-709dfdd7e5cacfa98a0911139bfcfe5cb8bb5c61.zip | |
hfs: Sanity check the root record
[ Upstream commit b905bafdea21a75d75a96855edd9e0b6051eee30 ]
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: syzbot+2db3c7526ba68f4ea776@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2db3c7526ba68f4ea776
Tested-by: syzbot+2db3c7526ba68f4ea776@syzkaller.appspotmail.com
Tested-by: Leo Stone <leocstone@gmail.com>
Signed-off-by: Leo Stone <leocstone@gmail.com>
Link: https://lore.kernel.org/r/20241201051420.77858-1-leocstone@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/git.orderFile')
0 files changed, 0 insertions, 0 deletions
