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: FilesystemSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: Cedric
Open/Closed: OpenRelease: 
Release: 2.02Reproducibility: 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
  • -unavailable- added by cedric_nokia (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1