fs/xfs: Fix out-of-bounds read
authorMichael Chang <mchang@suse.com>
Fri, 31 May 2024 07:14:57 +0000 (15:14 +0800)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit839c0dca85cdbd147a27ea4987370bbf15300c2d
tree9f8837d2a799130449769f1ca9f8e4b36f678226
parent85e99d4d9771a85f0b83cd7694c2311034388362
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>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-xfs-Fix-out-of-bounds-read.patch
grub-core/fs/xfs.c