diff options
| author | dan.carpenter@oracle.com <dan.carpenter@oracle.com> | 2020-01-15 20:46:28 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-11 07:51:14 +0100 |
| commit | f0f25649c86f2962e8e4497b699fe6b151a18b1a (patch) | |
| tree | 7048f36a62bda370a00970b0b0f2761e260399d6 /include/linux/debugobjects.h | |
| parent | 95a39fd3e6d029e501170eba852941410152cd32 (diff) | |
HID: hiddev: Fix race in in hiddev_disconnect()
commit 5c02c447eaeda29d3da121a2e17b97ccaf579b51 upstream.
Syzbot reports that "hiddev" is used after it's free in hiddev_disconnect().
The hiddev_disconnect() function sets "hiddev->exist = 0;" so
hiddev_release() can free it as soon as we drop the "existancelock"
lock. This patch moves the mutex_unlock(&hiddev->existancelock) until
after we have finished using it.
Reported-by: syzbot+784ccb935f9900cc7c9e@syzkaller.appspotmail.com
Fixes: 7f77897ef2b6 ("HID: hiddev: fix potential use-after-free")
Suggested-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
