Commit e24d7ace authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: misc: usbsevseg: fix up some sysfs attribute permissions

They should not be writable by any user.
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Harrison Metzger <harrisonmetz@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 48f11547
...@@ -192,7 +192,7 @@ static ssize_t set_attr_##name(struct device *dev, \ ...@@ -192,7 +192,7 @@ static ssize_t set_attr_##name(struct device *dev, \
\ \
return count; \ return count; \
} \ } \
static DEVICE_ATTR(name, S_IWUGO | S_IRUGO, show_attr_##name, set_attr_##name); static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, show_attr_##name, set_attr_##name);
static ssize_t show_attr_text(struct device *dev, static ssize_t show_attr_text(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -223,7 +223,7 @@ static ssize_t set_attr_text(struct device *dev, ...@@ -223,7 +223,7 @@ static ssize_t set_attr_text(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(text, S_IWUGO | S_IRUGO, show_attr_text, set_attr_text); static DEVICE_ATTR(text, S_IRUGO | S_IWUSR, show_attr_text, set_attr_text);
static ssize_t show_attr_decimals(struct device *dev, static ssize_t show_attr_decimals(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -272,8 +272,7 @@ static ssize_t set_attr_decimals(struct device *dev, ...@@ -272,8 +272,7 @@ static ssize_t set_attr_decimals(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(decimals, S_IWUGO | S_IRUGO, static DEVICE_ATTR(decimals, S_IRUGO | S_IWUSR, show_attr_decimals, set_attr_decimals);
show_attr_decimals, set_attr_decimals);
static ssize_t show_attr_textmode(struct device *dev, static ssize_t show_attr_textmode(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -319,8 +318,7 @@ static ssize_t set_attr_textmode(struct device *dev, ...@@ -319,8 +318,7 @@ static ssize_t set_attr_textmode(struct device *dev,
return -EINVAL; return -EINVAL;
} }
static DEVICE_ATTR(textmode, S_IWUGO | S_IRUGO, static DEVICE_ATTR(textmode, S_IRUGO | S_IWUSR, show_attr_textmode, set_attr_textmode);
show_attr_textmode, set_attr_textmode);
MYDEV_ATTR_SIMPLE_UNSIGNED(powered, update_display_powered); MYDEV_ATTR_SIMPLE_UNSIGNED(powered, update_display_powered);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment