bugGNU GRUB - Bugs: bug #58438, setpci write mask value is wrongly...

 
 

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

bug #58438: setpci write mask value is wrongly ignored

Submitted by:  Larry Carver <lcarver>
Submitted on:  Sun 24 May 2020 11:30:17 AM UTC  
Votes:  10  
 
Category:  None Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  None Privacy:  Public
Assigned to:  None Originator Name:  Larry Carver
Open/Closed:  Open Release: 
Release:  Git master Reproducibility:  Every Time
Planned Release:  None

Sun 24 May 2020 11:30:17 AM UTC, original submission:  

Problem -- Write mask value given to setpci is ignored.
Example --

grub> setpci -s b6:0.0 70.L
Register 70 of b6:00.0 is 27

grub> setpci -s b6:0.0 70.L=0:1

grub> setpci -s b6:0.0 70.L
Register 70 of b6:00.0 is 0

Reason -- I think the following assignment is wrong, and should be removed.
Please see the following line 315, following
  the assignment to write_mask and the error check.
The code is re-assigning the value to be 0xffffffff.
At
  https://github.com/coreos/grub/blob/master/grub-core/commands/setpci.c#L315

  write_mask = 0;
  if (*ptr == '=')
    {
      ptr++;
      regwrite = grub_strtoul (ptr, (char **) &ptr, 16);
      if (grub_errno)
       return grub_errno;
      write_mask = 0xffffffff;
      if (*ptr == ':')
       {
         ptr++;
         write_mask = grub_strtoul (ptr, (char **) &ptr, 16);
         if (grub_errno)
           return grub_errno;
         write_mask = 0xffffffff;    /*  <-- Why is this here ??  */
       }
      regwrite &= write_mask;
    }

Larry Carver <lcarver>

 

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 lcarver (Voted in favor of this item)
  • -email is unavailable- added by lcarver (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-05-24 lcarver Carbon-Copy- => Added lcarver

    Back to the top


    Powered by Savane 3.5