Skip to contentSkip to conversation

commands/setpci: honor write mask argument

PATCH In review Wouter van Kesteren 2 participants 4 messages Aug 12, 2021 – Aug 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 commands/setpci: honor write mask argument

In the case that one passes a write mask with :
the write_mask is obtained from grub_strtoul and then promptly overwritten by 0xffffffff three lines later.

This appears to have been so since the initial version of setpci in 2009. I'm suprised no one else has hit this issue in the past 12 years...

---
 grub-core/commands/setpci.c | 1 -
 1 file changed, 1 deletion(-)
grub-core/commands/setpci.c +0 -1
index 8a0c91f02..5917625f8 100644
@@ -311,7 +311,6 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
 	  write_mask = grub_strtoul (ptr, &ptr, 16);
 	  if (grub_errno)
 	    return grub_errno;
-	  write_mask = 0xffffffff;
 	}
       regwrite &= write_mask;
     }
Signature · 1 line
2.32.0
#1 lore raw
Quoted 6 lines · Wouter van Kesteren

In the case that one passes a write mask with :
the write_mask is obtained from grub_strtoul and then promptly overwritten by 0xffffffff three lines later.

This appears to have been so since the initial version of setpci in 2009. I'm suprised no one else has hit this issue in the past 12 years...

May I add "Signed-off-by: Wouter van Kesteren <[email protected]>" to this patch?

Otherwise Reviewed-by: Daniel Kiper <[email protected]>

Daniel

#2 lore raw
Quoted 6 lines · Daniel Kiper

May I add "Signed-off-by: Wouter van Kesteren <[email protected]>" to this patch?

Otherwise Reviewed-by: Daniel Kiper <[email protected]>

Daniel

Hey Daniel,

Thanks for the reply. You're more than welcome to add those two lines. That is assuming it means the same here as it does for the kernel.

I couldn't find any CONTRIBUTING document so i wasn't sure what the proper procedures would be.
If you want to be more formal just let me know and i can resubmit it in its entirety too.

#3 lore raw
Quoted 4 lines · Wouter van Kesteren
Quoted 3 lines · Daniel Kiper

May I add "Signed-off-by: Wouter van Kesteren <[email protected]>" to this patch?

Quoted 8 lines
Quoted 3 lines

Otherwise Reviewed-by: Daniel Kiper <[email protected]>

Daniel

Hey Daniel,

Thanks for the reply. You're more than welcome to add those two lines. That is assuming it means the same here as it does for the kernel.

Yep!

Quoted 4 lines

I couldn't find any CONTRIBUTING document so i wasn't sure what the proper procedures would be.
If you want to be more formal just let me know and i can resubmit it in its entirety too.

No, this is sufficient for now.

Thanks,

Daniel