bugGNU GRUB - Bugs: bug #52007, errno not correctly managed in...


You are not allowed to post comments on this tracker with your current authentication level.

bug #52007: errno not correctly managed in grub_file_open (kern/file.c)

Submitted by:  cedric <cedric_nokia>
Submitted on:  Wed 13 Sep 2017 07:53:36 AM UTC  
Category:  Filesystem Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Cedric
Open/Closed:  Open Release: 
Release:  2.02 Reproducibility:  Every Time
Planned Release:  None

Wed 13 Sep 2017 07:53:36 AM UTC, original submission:

In function grub_file_open(), grub_errno is used without been initialized before the call to grub_file_get_device_name().
Unfortunately, the NULL return value of grub_file_get_device_name() can be a valid result. So it doesn't allow to know if an error has occurred inside it. And by consequence, we don't know if grub_errno must be tested or not.

Reproducible: call a function that set grub_errno to an error value then call grub_file_open with a valid file.

Fix: grub_errno should be reset before the call to grub_file_get_device_name().

BR, Cedric.
grub_file_open (const char *name)
grub_device_t device = 0;
grub_file_t file = 0, last_file = 0;
char *device_name;
const char *file_name;
grub_file_filter_id_t filter;

device_name = grub_file_get_device_name (name);
if (grub_errno)
goto fail;

cedric <cedric_nokia>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by cedric_nokia (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.4