bugGNU GRUB - Bugs: bug #42409, grub-probe produces misleading...

 
 

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

bug #42409: grub-probe produces misleading errors and wrong info if user doesn't have permission to access drive

Submitted by:  Alain Kalker <ackalker>
Submitted on:  Fri 23 May 2014 03:08:13 PM UTC  
 
Category: Disk & PartitionSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: 
Open/Closed: OpenRelease: 
Release: otherReproducibility: Every Time
Planned Release: None

Fri 23 May 2014 03:08:13 PM UTC, original submission:

System details:
OS: Arch Linux x86_64
Grub: 2.02.beta2 installed on a GPT disk with protective MBR
Boot: using BIOS
GPT partition /dev//boot:

Using grub-probe on this setup works fine when running it with sudo:

$ sudo grub-probe --target=partmap /
gpt
$ sudo grub-probe --target=drive /
(hostdisk//dev/sda,gpt1)

However, running grub-probe as a user without read access to /dev/sda*, produces misleading errors, and ultimately gives incorrect information:

$ grub-probe --target=partmap /
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: error: disk `hostdisk//dev/sda1' not found.
$ grub-probe --target=drive /
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
grub-probe: warning: disk does not exist, so falling back to partition device /dev/sda1.
(hostdisk//dev/sda1)

Running the above commands under strace (filtering on open, stat, execve events, see attached files) shows that grub-probe running as unprivileged user encounters permission errors (EACCES) but doesn't report these to the user.

The errors which grub-probe does report are misleading: the disk does exist, but the current user simply has no permission to access it.
Also the final info is incorrect, as it doesn't identify the partition as being a GPT partition.

Both these issues can lead users trying to diagnose problems to look in the wrong place, or worse, apply the wrong fixes.
Note that in some environments such as SELinux, even running grub-probe under sudo, one might not have permission to access some devices!

From reading several reports on the net about grub-probe reporting "warning: disk does not exist", I think that grub-probe not reporting permssion problems may lie at the heart of at least some of these reports.

Please consider fixing grub-probe to report permission errors directly to the user.

Alain Kalker <ackalker>

 

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ackalker (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):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 May 2014 03:08:13 PM UTCackalkerAttached File-=>Added strace-grub-probe-target-partmap-verbose.log, #31424
      Attached File-=>Added strace-grub-probe-target-drive-verbose.log, #31425

    Back to the top


    Powered by Savane 3.1-cleanup