From: Vasiliy Kulikov Date: Fri, 4 Feb 2011 12:23:56 +0000 (+0300) Subject: platform: x86: acer-wmi: world-writable sysfs threeg file X-Git-Tag: v2.6.27.59~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=166e7fface1b580cffb17363eab47d59e4d07147;p=thirdparty%2Fkernel%2Fstable.git platform: x86: acer-wmi: world-writable sysfs threeg file commit b80b168f918bba4b847e884492415546b340e19d upstream. Don't allow everybody to write to hardware registers. Signed-off-by: Vasiliy Kulikov Signed-off-by: Matthew Garrett Signed-off-by: Greg Kroah-Hartman [wt: also fixed permission on interface] --- diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index d8b0d326e4522..aca21f7fe9a26 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c @@ -957,7 +957,7 @@ set_bool_##value(struct device *dev, struct device_attribute *attr, \ return -EINVAL; \ return count; \ } \ -static DEVICE_ATTR(value, S_IWUGO | S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, \ show_bool_##value, set_bool_##value); show_set_bool(wireless, ACER_CAP_WIRELESS); @@ -982,7 +982,7 @@ static ssize_t show_interface(struct device *dev, struct device_attribute *attr, } } -static DEVICE_ATTR(interface, S_IWUGO | S_IRUGO | S_IWUSR, +static DEVICE_ATTR(interface, S_IRUGO | S_IWUSR, show_interface, NULL); /*