[PATCH master] efi: loader: disk: don't install a file system on raw disks
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Nov 3 06:30:59 PST 2026
From: Ahmad Fatoum <a.fatoum at barebox.org>
efi_fs_exists() matches the detected type of a cdev against the type of
every registered file system driver. Drivers not backed by a cdev, like
ramfs, devfs or tftp, leave their type at filetype_unknown, so every
disk with unrecognized content matches one of them.
Let's skip filetype_unknown like fs_detect() does, so raw disks only
export Block I/O.
Fixes: 3146c70b0f8b ("efi: loader: protocol: add Block IO support")
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
efi/loader/protocols/disk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/efi/loader/protocols/disk.c b/efi/loader/protocols/disk.c
index 493be8c5aafe..d56c9116460d 100644
--- a/efi/loader/protocols/disk.c
+++ b/efi/loader/protocols/disk.c
@@ -163,7 +163,8 @@ static bool efi_fs_exists(struct cdev *cdev)
enum filetype filetype;
struct driver *drv;
- if (cdev_detect_type(cdev, &filetype))
+ /* drivers not backed by a cdev, e.g. ramfs, have no type to match */
+ if (cdev_detect_type(cdev, &filetype) || filetype == filetype_unknown)
return false;
bus_for_each_driver(&fs_bus, drv) {
--
2.47.3
More information about the barebox
mailing list