diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2016-02-06 02:08:08 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-03-09 23:26:15 +0100 |
commit | 1b6e75ee295990d866ded77c29ffc6f88b831e26 (patch) | |
tree | be2d35660bdbc4088286561852bf059121569ad5 /drivers/acpi | |
parent | f6cede5b49e822ebc41a099fe41ab4989f64e2cb (diff) | |
download | linux-stable-1b6e75ee295990d866ded77c29ffc6f88b831e26.tar.gz linux-stable-1b6e75ee295990d866ded77c29ffc6f88b831e26.tar.bz2 linux-stable-1b6e75ee295990d866ded77c29ffc6f88b831e26.zip |
ACPI / EC: Deny write access unless requested by module param
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/ec_sys.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c index bea8e425a8de..6c7dd7af789e 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) { |