dan.carpenter@oracle.com
9539c5cd71
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>
2020-03-11 18:02:50 +01:00
..
2019-11-06 12:43:32 +01:00
2019-12-05 15:37:26 +01:00
2020-03-11 18:02:50 +01:00
2019-08-29 08:26:40 +02:00
2017-03-21 15:03:55 +01:00
2016-10-07 09:59:48 +02:00
2019-10-07 18:55:10 +02:00
2015-11-05 09:51:50 -08:00
2017-08-08 10:05:23 +02:00
2015-10-21 13:15:53 +02:00
2019-11-06 12:43:33 +01:00
2017-06-08 13:47:52 +02:00
2016-03-02 10:31:36 +01:00
2020-03-11 18:02:49 +01:00
2017-03-21 14:46:15 +01:00
2019-09-10 10:32:17 +01:00
2017-01-06 16:06:43 +01:00
2019-05-08 07:20:47 +02:00
2019-11-06 12:43:33 +01:00
2017-10-11 15:46:22 +02:00
2018-03-19 08:42:47 +01:00
2019-11-06 12:43:33 +01:00
2019-11-06 12:43:33 +01:00
2015-08-18 15:03:43 +02:00
2015-11-05 10:15:35 -08:00
2015-12-28 13:41:44 +01:00
2019-08-25 10:50:06 +02:00
2019-11-06 12:43:33 +01:00
2019-11-06 12:43:06 +01:00
2020-02-05 14:18:05 +00:00
2020-01-14 20:05:44 +01:00
2020-03-11 18:02:49 +01:00
2017-02-27 18:43:47 -08:00
2016-10-10 10:47:03 +02:00
2019-02-12 19:46:09 +01:00
2019-11-06 12:43:33 +01:00
2019-11-06 12:43:33 +01:00
2019-11-06 12:43:33 +01:00
2017-11-02 11:10:55 +01:00
2019-10-05 12:47:33 +02:00
2017-11-02 11:10:55 +01:00
2019-11-06 12:43:33 +01:00
2017-04-06 14:36:36 +02:00
2020-01-04 13:59:45 +01:00
2017-06-20 10:38:17 +02:00
2017-01-11 22:12:44 +01:00
2017-01-20 15:17:19 +01:00
2018-12-13 09:18:48 +01:00
2017-03-06 13:16:33 +01:00
2018-10-03 17:00:52 -07:00
2017-07-24 17:38:21 +02:00
2016-03-10 17:17:26 +01:00
2015-06-29 14:51:12 +02:00
2017-08-20 10:02:48 -04:00
2017-03-24 15:45:04 +01:00
2015-06-29 14:51:12 +02:00
2015-12-28 13:41:44 +01:00
2018-08-03 07:50:33 +02:00
2019-10-05 12:47:32 +02:00
2017-06-22 14:44:11 +02:00
2018-04-24 09:36:28 +02:00
2015-12-28 13:41:51 +01:00
2015-12-28 13:41:51 +01:00
2015-12-28 13:41:51 +01:00
2015-12-28 13:41:51 +01:00
2015-12-28 13:41:51 +01:00
2018-04-26 11:02:10 +02:00
2015-12-28 13:41:51 +01:00
2015-12-28 13:41:51 +01:00
2017-03-02 08:42:32 +01:00
2018-10-10 08:54:23 +02:00
2018-12-17 09:28:49 +01:00
2018-12-17 09:28:49 +01:00
2019-11-06 12:43:33 +01:00
2015-12-28 13:41:44 +01:00
2019-11-06 12:43:33 +01:00
2017-04-06 14:50:11 +02:00
2016-11-15 14:23:17 +01:00
2016-09-19 14:32:21 +02:00
2016-03-18 17:31:38 +01:00
2015-12-28 13:41:44 +01:00
2017-03-24 15:43:03 +01:00
2019-11-06 12:43:33 +01:00
2020-01-17 19:45:40 +01:00
2018-06-21 04:02:48 +09:00
2017-11-02 11:10:55 +01:00
2020-01-17 19:45:40 +01:00
2019-09-21 07:15:26 +02:00
2019-11-12 19:18:04 +01:00
2019-07-31 07:28:41 +02:00
2019-11-12 19:18:04 +01:00