]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/sfs: Fix over-read of root object name
authorDaniel Axtens <dja@axtens.net>
Mon, 18 Jan 2021 03:34:58 +0000 (14:34 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commit8d3ae59dee2930d640add3bba983006e1f5dd1b6
treef5a5e65fcc31effd52ed941ca05bc6485a6b109d
parent1c15848838d924552611247110723e2a1c17a5a1
fs/sfs: Fix over-read of root object name

There's a read of the name of the root object that assumes that the name
is nul-terminated within the root block. This isn't guaranteed - it seems
SFS would require you to read multiple blocks to get a full name in general,
but maybe that doesn't apply to the root object.

Either way, figure out how much space is left in the root block and don't
over-read it. This fixes some OOB reads.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/sfs.c