grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SECURITY PATCH 011/117] commands/hdparm: Restrict hdparm command when l


From: Daniel Kiper
Subject: [SECURITY PATCH 011/117] commands/hdparm: Restrict hdparm command when locked down
Date: Tue, 2 Mar 2021 19:00:18 +0100

From: Javier Martinez Canillas <javierm@redhat.com>

The command can be used to get/set ATA disk parameters. Some of these can
be dangerous since change the disk behavior. Restrict it when locked down.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 grub-core/commands/hdparm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c
index d3fa9661e..2e2319e64 100644
--- a/grub-core/commands/hdparm.c
+++ b/grub-core/commands/hdparm.c
@@ -436,9 +436,9 @@ static grub_extcmd_t cmd;
 
 GRUB_MOD_INIT(hdparm)
 {
-  cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, 0,
-                             N_("[OPTIONS] DISK"),
-                             N_("Get/set ATA disk parameters."), options);
+  cmd = grub_register_extcmd_lockdown ("hdparm", grub_cmd_hdparm, 0,
+                                      N_("[OPTIONS] DISK"),
+                                      N_("Get/set ATA disk parameters."), 
options);
 }
 
 GRUB_MOD_FINI(hdparm)
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]