fs/xfs: Ensuring failing to mount sets a grub_errno
authorB Horn <b@horn.uk>
Sun, 12 May 2024 05:03:58 +0000 (06:03 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit5171d30be655b5f18294edc6009431ede36911c4
treecd29ac3b1d9bf6b7e7ba2ac24e925162004931b5
parent839c0dca85cdbd147a27ea4987370bbf15300c2d
fs/xfs: Ensuring failing to mount sets a grub_errno

It was previously possible for grub_xfs_mount() to return NULL without
setting grub_errno if the XFS version was invalid. This resulted in it
being possible for grub_dl_unref() to be called twice allowing the XFS
module to be unloaded while there were still references to it.

Fixing this problem in general by ensuring a grub_errno is set if the
fail label is reached.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-xfs-Ensuring-failing-to-mount-sets-a-grub_errno.patch
grub-core/fs/xfs.c