]> git.ipfire.org Git - thirdparty/grub.git/commit
fs/xfs: Fix out-of-bounds read
authorMichael Chang <mchang@suse.com>
Fri, 31 May 2024 07:14:57 +0000 (15:14 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 23 Jan 2025 15:22:47 +0000 (16:22 +0100)
commit6ccc77b59d16578b10eaf8a4fe85c20b229f0d8a
treeeffa8c2f086f43ba36523fec09e66cfdcdc6189b
parent067b6d225d482280abad03944f04e30abcbdafa1
fs/xfs: Fix out-of-bounds read

The number of records in the root key array read from disk was not being
validated against the size of the root node. This could lead to an
out-of-bounds read.

This patch adds a check to ensure that the number of records in the root
key array does not exceed the expected size of a root node read from
disk. If this check detects an out-of-bounds condition the operation is
aborted to prevent random errors due to metadata corruption.

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/fs/xfs.c