Blob Blame History Raw
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 25 Nov 2021 11:36:16 +0100
Subject: ACPI: EC: Mark the ec_sys write_support param as module_param_hw()
Patch-mainline: v5.17-rc1
Git-commit: b66f86849414807745b5c2129e2de5f27a788c9f
References: jsc#PED-1408

Using write_support=1 with the ec_sys module changes the mode of the
"io" debugfs file to 0600. This will cause any attempts to access it under
a kernel in lockdown mode to return -EPERM, which makes the entire ec_sys
module unusable.

Use the special module_param_hw() macro for module parameters which
may not be used while in lockdown mode, to avoid this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 drivers/acpi/ec_sys.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -19,7 +19,7 @@ MODULE_DESCRIPTION("ACPI EC sysfs access
 MODULE_LICENSE("GPL");
 
 static bool write_support;
-module_param(write_support, bool, 0644);
+module_param_hw(write_support, bool, other, 0644);
 MODULE_PARM_DESC(write_support, "Dangerous, reboot and removal of battery may "
 		 "be needed.");