Lee, Chun-Yi 133b51
From: Hans de Goede <hdegoede@redhat.com>
Lee, Chun-Yi 133b51
Date: Thu, 25 Nov 2021 11:36:16 +0100
Lee, Chun-Yi 133b51
Subject: ACPI: EC: Mark the ec_sys write_support param as module_param_hw()
Lee, Chun-Yi 133b51
Patch-mainline: v5.17-rc1
Lee, Chun-Yi 133b51
Git-commit: b66f86849414807745b5c2129e2de5f27a788c9f
Lee, Chun-Yi 133b51
References: jsc#PED-1408
Lee, Chun-Yi 133b51
Lee, Chun-Yi 133b51
Using write_support=1 with the ec_sys module changes the mode of the
Lee, Chun-Yi 133b51
"io" debugfs file to 0600. This will cause any attempts to access it under
Lee, Chun-Yi 133b51
a kernel in lockdown mode to return -EPERM, which makes the entire ec_sys
Lee, Chun-Yi 133b51
module unusable.
Lee, Chun-Yi 133b51
Lee, Chun-Yi 133b51
Use the special module_param_hw() macro for module parameters which
Lee, Chun-Yi 133b51
may not be used while in lockdown mode, to avoid this.
Lee, Chun-Yi 133b51
Lee, Chun-Yi 133b51
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Lee, Chun-Yi 133b51
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Lee, Chun-Yi 133b51
Acked-by: Lee, Chun-Yi <jlee@suse.com>
Lee, Chun-Yi 133b51
---
Lee, Chun-Yi 133b51
 drivers/acpi/ec_sys.c |    2 +-
Lee, Chun-Yi 133b51
 1 file changed, 1 insertion(+), 1 deletion(-)
Lee, Chun-Yi 133b51
Lee, Chun-Yi 133b51
--- a/drivers/acpi/ec_sys.c
Lee, Chun-Yi 133b51
+++ b/drivers/acpi/ec_sys.c
Lee, Chun-Yi 133b51
@@ -19,7 +19,7 @@ MODULE_DESCRIPTION("ACPI EC sysfs access
Lee, Chun-Yi 133b51
 MODULE_LICENSE("GPL");
Lee, Chun-Yi 133b51
 
Lee, Chun-Yi 133b51
 static bool write_support;
Lee, Chun-Yi 133b51
-module_param(write_support, bool, 0644);
Lee, Chun-Yi 133b51
+module_param_hw(write_support, bool, other, 0644);
Lee, Chun-Yi 133b51
 MODULE_PARM_DESC(write_support, "Dangerous, reboot and removal of battery may "
Lee, Chun-Yi 133b51
 		 "be needed.");
Lee, Chun-Yi 133b51