nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0381-commands-hdparm-Restrict-hdparm-command-when-locked-.patch

468bd4
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
468bd4
From: Javier Martinez Canillas <javierm@redhat.com>
468bd4
Date: Wed, 24 Feb 2021 12:59:29 +0100
468bd4
Subject: [PATCH] commands/hdparm: Restrict hdparm command when locked down
468bd4
468bd4
The command can be used to get/set ATA disk parameters. Some of these can
468bd4
be dangerous since change the disk behavior. Restrict it when locked down.
468bd4
468bd4
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
468bd4
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
468bd4
---
468bd4
 grub-core/commands/hdparm.c | 6 +++---
468bd4
 1 file changed, 3 insertions(+), 3 deletions(-)
468bd4
468bd4
diff --git a/grub-core/commands/hdparm.c b/grub-core/commands/hdparm.c
030dc3
index d3fa9661e5f..2e2319e645a 100644
468bd4
--- a/grub-core/commands/hdparm.c
468bd4
+++ b/grub-core/commands/hdparm.c
468bd4
@@ -436,9 +436,9 @@ static grub_extcmd_t cmd;
468bd4
 
468bd4
 GRUB_MOD_INIT(hdparm)
468bd4
 {
468bd4
-  cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, 0,
468bd4
-			      N_("[OPTIONS] DISK"),
468bd4
-			      N_("Get/set ATA disk parameters."), options);
468bd4
+  cmd = grub_register_extcmd_lockdown ("hdparm", grub_cmd_hdparm, 0,
468bd4
+				       N_("[OPTIONS] DISK"),
468bd4
+				       N_("Get/set ATA disk parameters."), options);
468bd4
 }
468bd4
 
468bd4
 GRUB_MOD_FINI(hdparm)