* [PATCH] ACPI / EC: Mark the ec_sys write_support param as module_param_hw()
@ 2021-11-25 10:36 Hans de Goede
2021-12-01 14:06 ` [External] " Mark Pearson
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2021-11-25 10:36 UTC (permalink / raw)
To: Rafael J . Wysocki; +Cc: Hans de Goede, Len Brown, linux-acpi, Mark Pearson
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.
Cc: Mark Pearson <markpearson@lenovo.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/ec_sys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index fd39c14493ab..c074a0fae059 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -19,7 +19,7 @@ MODULE_DESCRIPTION("ACPI EC sysfs access driver");
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.");
--
2.33.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [External] [PATCH] ACPI / EC: Mark the ec_sys write_support param as module_param_hw()
2021-11-25 10:36 [PATCH] ACPI / EC: Mark the ec_sys write_support param as module_param_hw() Hans de Goede
@ 2021-12-01 14:06 ` Mark Pearson
2021-12-01 19:21 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Mark Pearson @ 2021-12-01 14:06 UTC (permalink / raw)
To: Hans de Goede, Rafael J . Wysocki; +Cc: Len Brown, linux-acpi
On 2021-11-25 05:36, Hans de Goede wrote:
> 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.
>
> Cc: Mark Pearson <markpearson@lenovo.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/acpi/ec_sys.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
> index fd39c14493ab..c074a0fae059 100644
> --- a/drivers/acpi/ec_sys.c
> +++ b/drivers/acpi/ec_sys.c
> @@ -19,7 +19,7 @@ MODULE_DESCRIPTION("ACPI EC sysfs access driver");
> 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.");
>
>
Looks good to me. Thanks Hans
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [External] [PATCH] ACPI / EC: Mark the ec_sys write_support param as module_param_hw()
2021-12-01 14:06 ` [External] " Mark Pearson
@ 2021-12-01 19:21 ` Rafael J. Wysocki
0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2021-12-01 19:21 UTC (permalink / raw)
To: Mark Pearson, Hans de Goede
Cc: Rafael J . Wysocki, Len Brown, ACPI Devel Maling List
On Wed, Dec 1, 2021 at 3:06 PM Mark Pearson <markpearson@lenovo.com> wrote:
>
>
> On 2021-11-25 05:36, Hans de Goede wrote:
> > 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.
> >
> > Cc: Mark Pearson <markpearson@lenovo.com>
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> > drivers/acpi/ec_sys.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
> > index fd39c14493ab..c074a0fae059 100644
> > --- a/drivers/acpi/ec_sys.c
> > +++ b/drivers/acpi/ec_sys.c
> > @@ -19,7 +19,7 @@ MODULE_DESCRIPTION("ACPI EC sysfs access driver");
> > 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.");
> >
> >
> Looks good to me. Thanks Hans
> Mark
Patch applied as 5.17 material, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-01 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 10:36 [PATCH] ACPI / EC: Mark the ec_sys write_support param as module_param_hw() Hans de Goede
2021-12-01 14:06 ` [External] " Mark Pearson
2021-12-01 19:21 ` Rafael J. Wysocki
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.