Samir Virmani
b7bd4a2b42
uart: Fix crash in uart_write and uart_put_char
commit aff9cf5955 upstream.
We were experiencing a crash similar to the one reported as part of
commit:a5ba1d95e46e ("uart: fix race between uart_put_char() and
uart_shutdown()") in our testbed as well. We continue to observe the same
crash after integrating the commit a5ba1d95e4 ("uart: fix race between
uart_put_char() and uart_shutdown()")
On reviewing the change, the port lock should be taken prior to checking for
if (!circ->buf) in fn. __uart_put_char and other fns. that update the buffer
uart_state->xmit.
Traceback:
[11/27/2018 06:24:32.4870] Unable to handle kernel NULL pointer dereference
at virtual address 0000003b
[11/27/2018 06:24:32.4950] PC is at memcpy+0x48/0x180
[11/27/2018 06:24:32.4950] LR is at uart_write+0x74/0x120
[11/27/2018 06:24:32.4950] pc : [<ffffffc0002e6808>]
lr : [<ffffffc0003747cc>] pstate: 000001c5
[11/27/2018 06:24:32.4950] sp : ffffffc076433d30
[11/27/2018 06:24:32.4950] x29: ffffffc076433d30 x28: 0000000000000140
[11/27/2018 06:24:32.4950] x27: ffffffc0009b9d5e x26: ffffffc07ce36580
[11/27/2018 06:24:32.4950] x25: 0000000000000000 x24: 0000000000000140
[11/27/2018 06:24:32.4950] x23: ffffffc000891200 x22: ffffffc01fc34000
[11/27/2018 06:24:32.4950] x21: 0000000000000fff x20: 0000000000000076
[11/27/2018 06:24:32.4950] x19: 0000000000000076 x18: 0000000000000000
[11/27/2018 06:24:32.4950] x17: 000000000047cf08 x16: ffffffc000099e68
[11/27/2018 06:24:32.4950] x15: 0000000000000018 x14: 776d726966205948
[11/27/2018 06:24:32.4950] x13: 50203a6c6974755f x12: 74647075205d3333
[11/27/2018 06:24:32.4950] x11: 3a35323a36203831 x10: 30322f37322f3131
[11/27/2018 06:24:32.4950] x9 : 5b205d303638342e x8 : 746164206f742070
[11/27/2018 06:24:32.4950] x7 : 7520736920657261 x6 : 000000000000003b
[11/27/2018 06:24:32.4950] x5 : 000000000000817a x4 : 0000000000000008
[11/27/2018 06:24:32.4950] x3 : 2f37322f31312a5b x2 : 000000000000006e
[11/27/2018 06:24:32.4950] x1 : ffffffc0009b9cf0 x0 : 000000000000003b
[11/27/2018 06:24:32.4950] CPU2: stopping
[11/27/2018 06:24:32.4950] CPU: 2 PID: 0 Comm: swapper/2 Tainted: P D O 4.1.51 #3
[11/27/2018 06:24:32.4950] Hardware name: Broadcom-v8A (DT)
[11/27/2018 06:24:32.4950] Call trace:
[11/27/2018 06:24:32.4950] [<ffffffc0000883b8>] dump_backtrace+0x0/0x150
[11/27/2018 06:24:32.4950] [<ffffffc00008851c>] show_stack+0x14/0x20
[11/27/2018 06:24:32.4950] [<ffffffc0005ee810>] dump_stack+0x90/0xb0
[11/27/2018 06:24:32.4950] [<ffffffc00008e844>] handle_IPI+0x18c/0x1a0
[11/27/2018 06:24:32.4950] [<ffffffc000080c68>] gic_handle_irq+0x88/0x90
Fixes: a5ba1d95e4 ("uart: fix race between uart_put_char() and uart_shutdown()")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Samir Virmani <samir@embedur.com>
Acked-by: Tycho Andersen <tycho@tycho.ws>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-31 08:12:35 +01:00
..
2018-12-13 09:20:29 +01:00
2018-10-03 17:01:49 -07:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2019-01-26 09:38:32 +01:00
2016-08-04 08:50:07 -04:00
2018-05-25 16:13:14 +02:00
2018-06-16 09:52:34 +02:00
2016-09-02 15:01:16 +02:00
2016-07-06 17:38:16 +02:00
2016-09-02 15:03:35 +02:00
2018-05-01 15:13:09 -07:00
2017-06-24 07:11:14 +02:00
2018-10-03 17:01:49 -07:00
2017-06-14 15:05:54 +02:00
2018-10-03 17:01:51 -07:00
2016-10-27 16:00:31 +02:00
2018-12-13 09:20:30 +01:00
2016-06-25 14:00:06 -07:00
2016-05-20 20:57:27 -07:00
2016-09-15 12:35:49 +02:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-06-25 14:01:57 -07:00
2017-02-26 11:10:51 +01:00
2018-10-10 08:53:17 +02:00
2018-05-25 16:13:14 +02:00
2017-11-24 08:33:42 +01:00
2016-10-27 16:01:31 +02:00
2019-01-26 09:38:32 +01:00
2016-06-25 09:01:52 -07:00
2016-06-25 14:00:06 -07:00
2018-06-16 09:52:34 +02:00
2016-08-31 15:39:58 +02:00
2018-11-21 09:25:57 +01:00
2018-05-19 10:27:00 +02:00
2019-01-31 08:12:35 +01:00
2016-06-25 14:30:42 -07:00
2016-06-25 14:30:42 -07:00
2016-06-25 09:01:52 -07:00
2018-07-03 11:23:06 +02:00
2016-06-25 09:09:53 -07:00
2016-06-25 14:01:57 -07:00
2016-05-27 15:26:11 -07:00
2016-09-02 15:01:16 +02:00
2016-09-27 12:55:27 +02:00
2016-10-27 16:00:31 +02:00
2018-12-21 14:11:36 +01:00
2017-10-21 17:21:35 +02:00
2019-01-13 10:03:50 +01:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-08-31 15:42:28 +02:00
2019-01-26 09:38:32 +01:00