dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0380-commands-setpci-Restrict-setpci-command-when-locked-.patch

80913e
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
80913e
From: Javier Martinez Canillas <javierm@redhat.com>
80913e
Date: Wed, 24 Feb 2021 22:59:59 +0100
80913e
Subject: [PATCH] commands/setpci: Restrict setpci command when locked down
80913e
80913e
This command can set PCI devices register values, which makes it dangerous
80913e
in a locked down configuration. Restrict it so can't be used on this setup.
80913e
80913e
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
80913e
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
80913e
---
80913e
 grub-core/commands/setpci.c | 8 ++++----
80913e
 1 file changed, 4 insertions(+), 4 deletions(-)
80913e
80913e
diff --git a/grub-core/commands/setpci.c b/grub-core/commands/setpci.c
80913e
index d5bc97d60b2..fa2ba7d8919 100644
80913e
--- a/grub-core/commands/setpci.c
80913e
+++ b/grub-core/commands/setpci.c
80913e
@@ -329,10 +329,10 @@ static grub_extcmd_t cmd;
80913e
 
80913e
 GRUB_MOD_INIT(setpci)
80913e
 {
80913e
-  cmd = grub_register_extcmd ("setpci", grub_cmd_setpci, 0,
80913e
-			      N_("[-s POSITION] [-d DEVICE] [-v VAR] "
80913e
-				 "REGISTER[=VALUE[:MASK]]"),
80913e
-			      N_("Manipulate PCI devices."), options);
80913e
+  cmd = grub_register_extcmd_lockdown ("setpci", grub_cmd_setpci, 0,
80913e
+				       N_("[-s POSITION] [-d DEVICE] [-v VAR] "
80913e
+					  "REGISTER[=VALUE[:MASK]]"),
80913e
+				       N_("Manipulate PCI devices."), options);
80913e
 }
80913e
 
80913e
 GRUB_MOD_FINI(setpci)