aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2013-04-16 15:40:09 -0700
committerJiri Kosina <jkosina@suse.cz>2013-04-30 10:09:31 +0200
commit2353f2bea307390e015493118e425152b8a5a431 (patch)
treebeb7fd2471690bbd8b0d0982c3b1f40f6784adba /include
parenta5f04b9df1113e0c16271afe5e43028f0d763f13 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hid.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h
index e14b465b114..06579c72d19 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -512,6 +512,7 @@ struct hid_device { /* device report descriptor */
struct dentry *debug_rdesc;
struct dentry *debug_events;
struct list_head debug_list;
+ struct mutex debug_list_lock;
wait_queue_head_t debug_wait;
};