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

 
 

You are not allowed to post comments on this tracker with your current authentication 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: 2.03+

Tue 23 Aug 2016 10:34:50 AM UTC, comment #3:

OK, posted: http://lists.gnu.org/archive/html/grub-devel/2016-08/msg00082.html

Antonio Ospite <ao2>
Wed 10 Aug 2016 04:41:55 PM UTC, comment #2:

Sure, if you have patch by all means do it. Please send it to grub-devel, and reference bug number in commit message.

Andrei Borzenkov <arvidjaar>
Project Member
Wed 10 Aug 2016 01:39:18 PM UTC, comment #1:

Hi,

I agree with Alain that the error message should be improved.

I ran into this issue when using systemd-nspawn which by default restricts access to the devices in the container, here is an example:

the message says that the disk does not exist but it does, and in my case the error is that it cannot be opened:

So if grub would just tell "Operation not permitted" it would be easier for the user to understand what is going on.

Should we send a patch?

Thanks,
Antonio

Antonio Ospite <ao2>
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 arvidjaar (Posted a comment)
  • -unavailable- added by ao2 (Posted a comment)
  • -unavailable- added by phcoder (Updated the item)
  • -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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 05 Mar 2017 07:01:35 PM UTCphcoderPlanned Release2.02=>2.03+
    Wed 02 Mar 2016 12:43:12 PM UTCphcoderPlanned ReleaseNone=>2.02
    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-cleanup1