Skip to content
Commit 6cb4b040 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

HID: hiddev: fix race between hiddev_disconnect and hiddev_release



When hiddev_disconnect() runs with chardev open, it will proceed with
usbhid_close(). When userspace in parallel runs the hiddev_release(),
it sees !hiddev->exists (as it has been already set so by
hiddev_disconnect()) and kfrees hiddev while hiddev_disconnect() hasn't
finished yet.

Serialize the access to hiddev->exists and hiddev->open by existancelock.

Reported-by: default avatar <mike-@cinci.rr.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 437f3b19
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