nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0381-commands-hdparm-Restrict-hdparm-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 12:59:29 +0100
80913e
Subject: [PATCH] commands/hdparm: Restrict hdparm command when locked down
80913e
80913e
The command can be used to get/set ATA disk parameters. Some of these can
80913e
be dangerous since change the disk behavior. Restrict it when locked down.
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/hdparm.c | 6 +++---
80913e
 1 file changed, 3 insertions(+), 3 deletions(-)
80913e
80913e
diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c
b32e65
index d3fa9661e..2e2319e64 100644
80913e
--- a/grub-core/commands/hdparm.c
80913e
+++ b/grub-core/commands/hdparm.c
80913e
@@ -436,9 +436,9 @@ static grub_extcmd_t cmd;
80913e
 
80913e
 GRUB_MOD_INIT(hdparm)
80913e
 {
80913e
-  cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, 0,
80913e
-			      N_("[OPTIONS] DISK"),
80913e
-			      N_("Get/set ATA disk parameters."), options);
80913e
+  cmd = grub_register_extcmd_lockdown ("hdparm", grub_cmd_hdparm, 0,
80913e
+				       N_("[OPTIONS] DISK"),
80913e
+				       N_("Get/set ATA disk parameters."), options);
80913e
 }
80913e
 
80913e
 GRUB_MOD_FINI(hdparm)