From: Wouter van Kesteren Date: Thu, 12 Aug 2021 14:56:13 +0000 (+0200) Subject: commands/setpci: Honor write mask argument X-Git-Tag: grub-2.12-rc1~584 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8b98cc66b7cb4b4123d1039d2e3df4d2fc5d44f;p=thirdparty%2Fgrub.git 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 surprised no one else has hit this issue in the past 12 years... Signed-off-by: Wouter van Kesteren Reviewed-by: Daniel Kiper --- diff --git a/grub-core/commands/setpci.c b/grub-core/commands/setpci.c index 8a0c91f02..5917625f8 100644 --- a/grub-core/commands/setpci.c +++ b/grub-core/commands/setpci.c @@ -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; }