mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 12:40:53 +07: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
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user