From e8b98cc66b7cb4b4123d1039d2e3df4d2fc5d44f Mon Sep 17 00:00:00 2001 From: Wouter van Kesteren Date: Thu, 12 Aug 2021 16:56:13 +0200 Subject: [PATCH] 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 --- grub-core/commands/setpci.c | 1 - 1 file changed, 1 deletion(-) 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; }