From: Daniel Kurtz Date: Wed, 9 May 2012 05:30:14 +0000 (-0700) Subject: Input: atmel_mxt_ts - only allow root to update firmware X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=71b3e938cb97f6cf324fb5aaca46d8e400dc38f0;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git Input: atmel_mxt_ts - only allow root to update firmware Restrict permissions on the update_fw sysfs entry to read only for root only. Also, update object permission to use a macro S_IRUGO macro instead of hard coded 0444. Signed-off-by: Daniel Kurtz Reviewed-by: Joonyoung Shim Acked-by: Nick Dyer Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 0a6e368a5a9c..15ae6fd575b2 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1049,8 +1049,8 @@ static ssize_t mxt_update_fw_store(struct device *dev, return count; } -static DEVICE_ATTR(object, 0444, mxt_object_show, NULL); -static DEVICE_ATTR(update_fw, 0664, NULL, mxt_update_fw_store); +static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL); +static DEVICE_ATTR(update_fw, S_IWUSR, NULL, mxt_update_fw_store); static struct attribute *mxt_attrs[] = { &dev_attr_object.attr,