Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1355464 > unrolled thread
| Started by | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| First post | 2016-03-11 00:40 +0100 |
| Last post | 2016-03-11 00:40 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] acpi/ec: Deny write access unless requested by module param "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-03-11 00:40 +0100
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2016-03-11 00:40 +0100 |
| Subject | Re: [PATCH] acpi/ec: Deny write access unless requested by module param |
| Message-ID | <rbils-5Ng-25@gated-at.bofh.it> |
On Saturday, February 06, 2016 02:08:08 AM green@linuxhacker.ru wrote:
> From: Oleg Drokin <green@linuxhacker.ru>
>
> In debugfs it's not enough to just set file mode to read-only to
> deny write access to a file, instead just don't provide
> the write method unless write access is really requested.
>
> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
> ---
> I assume allowing run-time changes via /sys/module is preferrable,
> opposed to forced module unload and reload to change this option,
> but I can submit another patch to only depend on the module parameter
> too, please let me know.
>
> drivers/acpi/ec_sys.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
> index bea8e42..6c7dd7a 100644
> --- a/drivers/acpi/ec_sys.c
> +++ b/drivers/acpi/ec_sys.c
> @@ -73,6 +73,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
> loff_t init_off = *off;
> int err = 0;
>
> + if (!write_support)
> + return -EINVAL;
> +
> if (*off >= EC_SPACE_SIZE)
> return 0;
> if (*off + count >= EC_SPACE_SIZE) {
>
Applied, thanks!
Rafael
Back to top | Article view | linux.kernel
csiph-web