0009-fs-iso9660-Set-a-grub_errno-if-mount-fails.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From a0e37c98e6f330110e4009f8e5ba73ca0c2eaff5 Mon Sep 17 00:00:00 2001
  2. From: B Horn <b@horn.uk>
  3. Date: Sun, 12 May 2024 06:37:08 +0100
  4. Subject: [PATCH] fs/iso9660: Set a grub_errno if mount fails
  5. It was possible for a grub_errno to not be set if mount of an ISO 9660
  6. filesystem failed when set_rockridge() returned 0.
  7. This isn't known to be exploitable as the other filesystems due to
  8. filesystem helper checking the requested file type. Though fixing
  9. as a precaution.
  10. Reported-by: B Horn <b@horn.uk>
  11. Signed-off-by: B Horn <b@horn.uk>
  12. Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
  13. Upstream: 965db5970811d18069b34f28f5f31ddadde90a97
  14. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  15. ---
  16. grub-core/fs/iso9660.c | 3 +++
  17. 1 file changed, 3 insertions(+)
  18. diff --git a/grub-core/fs/iso9660.c b/grub-core/fs/iso9660.c
  19. index 8c348b59a..8d480e602 100644
  20. --- a/grub-core/fs/iso9660.c
  21. +++ b/grub-core/fs/iso9660.c
  22. @@ -551,6 +551,9 @@ grub_iso9660_mount (grub_disk_t disk)
  23. return data;
  24. fail:
  25. + if (grub_errno == GRUB_ERR_NONE)
  26. + grub_error (GRUB_ERR_BAD_FS, "not a ISO9660 filesystem");
  27. +
  28. grub_free (data);
  29. return 0;
  30. }
  31. --
  32. 2.50.1