diff options
| author | Alan Stern <stern@rowland.harvard.edu> | 2013-09-24 15:43:39 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-25 17:27:01 -0700 |
| commit | 232275a089dfd2e77377a85f11d0a4e3ca60e612 (patch) | |
| tree | 14d96e68ff15d0751996e123ff6c9e7e8ff232b5 /scripts/patch-kernel | |
| parent | 9a37a50349c8d6a7adcee21cefae407fb2f8c623 (diff) | |
| download | cachepc-linux-232275a089dfd2e77377a85f11d0a4e3ca60e612.tar.gz cachepc-linux-232275a089dfd2e77377a85f11d0a4e3ca60e612.zip | |
USB: fix substandard locking for the sysfs files
This patch straightens out some locking issues in the USB sysfs
interface:
Deauthorization will destroy existing configurations.
Attributes that read from udev->actconfig need to lock the
device to prevent races. Likewise for the rawdescriptor
values.
Attributes that access an interface's current alternate
setting should use ACCESS_ONCE() to obtain the cur_altsetting
pointer, to protect against concurrent altsetting changes.
The supports_autosuspend() attribute routine accesses values
from an interface's driver, so it should lock the interface
(rather than the usb_device) to protect against concurrent
unbinds. Once this is done, the routine can be simplified
considerably.
Scalar values that are stored directly in the usb_device structure are
always available. They do not require any locking. The same is true
of the cached interface string descriptor, because it is not
deallocated until the usb_host_interface structure is destroyed.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/patch-kernel')
0 files changed, 0 insertions, 0 deletions
