Skip to content

Commit

Permalink
ACPI / EC: Deny write access unless requested by module param
Browse files Browse the repository at this point in the history
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>
Acked-by: Thomas Renninger <trenn@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
verygreen authored and rafaeljw committed Mar 9, 2016
1 parent f6cede5 commit 1b6e75e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/ec_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1b6e75e

Please sign in to comment.