Commit c990600d340641150f7270470a64bd99a5c0b225

Authored by Greg Kroah-Hartman
1 parent d9624e75f6

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

They should not be writable by any user.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oliver Bock <bock@tfh-berlin.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 2 additions and 4 deletions Side-by-side Diff

drivers/usb/misc/cypress_cy7c63.c
... ... @@ -196,11 +196,9 @@
196 196 return read_port(dev, attr, buf, 1, CYPRESS_READ_PORT_ID1);
197 197 }
198 198  
199   -static DEVICE_ATTR(port0, S_IWUGO | S_IRUGO,
200   - get_port0_handler, set_port0_handler);
  199 +static DEVICE_ATTR(port0, S_IRUGO | S_IWUSR, get_port0_handler, set_port0_handler);
201 200  
202   -static DEVICE_ATTR(port1, S_IWUGO | S_IRUGO,
203   - get_port1_handler, set_port1_handler);
  201 +static DEVICE_ATTR(port1, S_IRUGO | S_IWUSR, get_port1_handler, set_port1_handler);
204 202  
205 203  
206 204 static int cypress_probe(struct usb_interface *interface,