Jia-Ju Bai
55b3d640c3
usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable()
...
commit c85400f886 upstream.
The function r8a66597_endpoint_disable() and r8a66597_urb_enqueue() may
be concurrently executed.
The two functions both access a possible shared variable "hep->hcpriv".
This shared variable is freed by r8a66597_endpoint_disable() via the
call path:
r8a66597_endpoint_disable
kfree(hep->hcpriv) (line 1995 in Linux-4.19)
This variable is read by r8a66597_urb_enqueue() via the call path:
r8a66597_urb_enqueue
spin_lock_irqsave(&r8a66597->lock)
init_pipe_info
enable_r8a66597_pipe
pipe = hep->hcpriv (line 802 in Linux-4.19)
The read operation is protected by a spinlock, but the free operation
is not protected by this spinlock, thus a concurrency use-after-free bug
may occur.
To fix this bug, the spin-lock and spin-unlock function calls in
r8a66597_endpoint_disable() are moved to protect the free operation.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com >
Cc: stable <stable@vger.kernel.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-01-09 17:14:47 +01:00
..
2017-07-30 07:26:52 -07:00
2016-09-27 12:20:17 +02:00
2016-03-03 20:37:41 -08:00
2017-12-10 13:40:44 +01:00
2017-06-13 10:48:24 +02:00
2017-08-31 18:08:46 +02:00
2015-07-22 16:44:35 -07:00
2015-01-09 12:31:53 -08:00
2017-03-16 18:03:31 +09:00
2018-02-28 10:19:42 +01:00
2017-03-23 08:20:21 +01:00
2016-06-07 22:15:25 -07:00
2014-11-07 09:01:50 -08:00
2014-11-07 09:01:50 -08:00
2017-08-10 11:36:50 -07:00
2017-03-17 13:32:59 +09:00
2016-10-24 14:36:25 +02:00
2017-05-17 11:52:44 +02:00
2015-01-09 12:31:53 -08:00
2015-01-09 12:31:53 -08:00
2013-12-08 18:06:46 -08:00
2016-11-03 10:38:24 +02:00
2017-05-17 12:20:53 +02:00
2015-01-09 12:31:53 -08:00
2016-04-28 12:35:36 -07:00
2016-06-30 07:44:21 +01:00
2015-08-18 10:05:23 -07:00
2016-06-07 22:15:25 -07:00
2015-01-09 12:31:53 -08:00
2017-06-03 18:08:04 +09:00
2016-11-29 17:36:43 +01:00
2015-01-09 12:31:53 -08:00
2016-12-05 15:13:58 +01:00
2014-07-09 16:13:03 -07:00
2016-08-30 19:17:37 +02:00
2015-12-22 17:12:56 -06:00
2010-05-20 13:21:30 -07:00
2010-05-20 13:21:30 -07:00
2016-05-09 13:08:46 +02:00
2015-12-04 08:25:58 -08:00
2015-12-22 17:12:56 -06:00
2017-06-03 18:08:04 +09:00
2017-11-02 11:10:55 +01:00
2017-07-22 15:56:53 +02:00
2018-12-13 09:18:51 +01:00
2013-12-03 10:34:33 -08:00
2017-08-31 18:08:46 +02:00
2013-12-03 10:34:33 -08:00
2017-07-30 07:26:52 -07:00
2017-11-02 11:10:55 +01:00
2017-07-30 07:26:51 -07:00
2017-11-02 11:10:55 +01:00
2018-02-22 15:42:31 +01:00
2017-11-02 11:10:55 +01:00
2017-07-30 07:26:51 -07:00
2018-11-13 11:14:57 -08:00
2016-11-29 17:31:36 +01:00
2015-05-10 16:01:11 +02:00
2017-01-10 17:00:42 +01:00
2018-05-25 16:17:38 +02:00
2018-02-28 10:19:41 +01:00
2016-11-21 17:33:40 +01:00
2016-12-08 17:50:09 +01:00
2017-08-15 08:27:22 +01:00
2017-03-23 08:13:21 +01:00
2017-06-03 18:08:04 +09:00
2015-01-09 12:31:53 -08:00
2013-12-08 18:06:46 -08:00
2017-06-29 14:49:06 +02:00
2018-02-28 10:19:42 +01:00
2016-12-05 16:32:51 +01:00
2016-08-30 19:24:59 +02:00
2017-09-01 11:59:17 +02:00
2015-10-04 10:51:58 +01:00
2016-06-30 07:44:20 +01:00
2015-01-09 12:31:53 -08:00
2017-09-01 11:59:17 +02:00
2017-03-23 08:13:21 +01:00
2017-03-16 18:03:31 +09:00
2017-11-02 11:10:55 +01:00
2018-05-30 07:51:56 +02:00
2018-05-30 07:51:56 +02:00
2019-01-09 17:14:47 +01:00
2012-07-30 17:25:12 -07:00
2014-01-08 15:01:39 -08:00
2017-07-30 07:26:51 -07:00
2017-11-02 11:10:55 +01:00
2015-06-08 14:26:22 -07:00
2018-09-26 08:38:07 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-05-25 14:30:13 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-04-08 12:17:42 +02:00
2017-01-25 10:59:06 +01:00
2018-12-29 13:39:08 +01:00
2018-07-17 11:39:26 +02:00
2016-11-03 10:38:22 +02:00
2018-10-13 09:27:26 +02:00
2017-01-19 10:37:16 +01:00
2016-04-26 16:08:02 -07:00
2016-04-26 16:08:02 -07:00
2018-12-13 09:18:52 +01:00
2018-05-25 16:17:38 +02:00
2017-04-19 19:59:17 +02:00
2018-03-19 08:42:45 +01:00
2017-04-19 19:59:17 +02:00
2018-12-01 09:42:59 +01:00
2018-08-24 13:09:06 +02:00
2014-10-03 14:44:45 -07:00
2018-07-08 15:30:47 +02:00
2018-12-13 09:18:52 +01:00
2018-12-29 13:39:08 +01:00