]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
commands/setpci: Honor write mask argument
authorWouter van Kesteren <woutershep@gmail.com>
Thu, 12 Aug 2021 14:56:13 +0000 (16:56 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 6 Sep 2021 13:08:23 +0000 (15:08 +0200)
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 <woutershep@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/setpci.c

index 8a0c91f02bec2ada8067fe784e190af7af838537..5917625f8cbff3b467fbd3333191a9f1cf513659 100644 (file)
@@ -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;
     }