mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
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>
This commit is contained in:
parent
f6cede5b49
commit
1b6e75ee29
1 changed files with 3 additions and 0 deletions
|
@ -73,6 +73,9 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
|
||||||
loff_t init_off = *off;
|
loff_t init_off = *off;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
if (!write_support)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
if (*off >= EC_SPACE_SIZE)
|
if (*off >= EC_SPACE_SIZE)
|
||||||
return 0;
|
return 0;
|
||||||
if (*off + count >= EC_SPACE_SIZE) {
|
if (*off + count >= EC_SPACE_SIZE) {
|
||||||
|
|
Loading…
Reference in a new issue