HID: protect hid_debug_list
authorJiri Kosina <jkosina@suse.cz>
Tue, 16 Apr 2013 22:40:09 +0000 (15:40 -0700)
committerJiri Kosina <jkosina@suse.cz>
Tue, 30 Apr 2013 08:09:31 +0000 (10:09 +0200)
commit2353f2bea307390e015493118e425152b8a5a431
treebeb7fd2471690bbd8b0d0982c3b1f40f6784adba
parenta5f04b9df1113e0c16271afe5e43028f0d763f13
HID: protect hid_debug_list

Accesses to hid_device->hid_debug_list are not serialized properly, which
could result in SMP concurrency issues when HID debugfs events are accessesed
by multiple userspace processess.

Serialize all the list operations by a mutex.

Spotted by Al Viro.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-core.c
drivers/hid/hid-debug.c
include/linux/hid.h