linux-stable/drivers/bluetooth
Lukas Wunner 4a53c4e84a Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops
commit d73e172816 upstream.

John Stultz reports a boot time crash with the HiKey board (which uses
hci_serdev) occurring in hci_uart_tx_wakeup().  That function is
contained in hci_ldisc.c, but also called from the newer hci_serdev.c.
It acquires the proto_lock in struct hci_uart and it turns out that we
forgot to init the lock in the serdev code path, thus causing the crash.

John bisected the crash to commit 67d2f8781b ("Bluetooth: hci_ldisc:
Allow sleeping while proto locks are held"), but the issue was present
before and the commit merely exposed it.  (Perhaps by luck, the crash
did not occur with rwlocks.)

Init the proto_lock in the serdev code path to avoid the oops.

Stack trace for posterity:

Unable to handle kernel read from unreadable memory at 406f127000
[000000406f127000] user address but active_mm is swapper
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Hardware name: HiKey Development Board (DT)
Call trace:
 hci_uart_tx_wakeup+0x38/0x148
 hci_uart_send_frame+0x28/0x38
 hci_send_frame+0x64/0xc0
 hci_cmd_work+0x98/0x110
 process_one_work+0x134/0x330
 worker_thread+0x130/0x468
 kthread+0xf8/0x128
 ret_from_fork+0x10/0x18

Link: https://lkml.org/lkml/2017/11/15/908
Reported-and-tested-by: John Stultz <john.stultz@linaro.org>
Cc: Ronald Tschalär <ronald@innovation.ch>
Cc: Rob Herring <rob.herring@linaro.org>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-15 18:12:49 +02:00
..
ath3k.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
bcm203x.c bluetooth: bcm203x: don't print error when allocating urb fails 2016-09-27 12:20:17 +02:00
bfusb.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
bluecard_cs.c Bluetooth: bluecard: blink LED during continuous activity 2017-08-07 19:42:07 +02:00
bpa10x.c networking: make skb_push & __skb_push return void pointers 2017-06-16 11:48:40 -04:00
bt3c_cs.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
btbcm.c Bluetooth: btbcm: Consolidate the controller information commands 2017-08-17 12:11:24 +03:00
btbcm.h
btintel.c Bluetooth: btintel: Add MODULE_FIRMWARE entries for iBT 3.5 controllers 2017-05-23 19:54:55 +02:00
btintel.h
btmrvl_debugfs.c
btmrvl_drv.h Bluetooth: btmrvl: drop duplicate header slab.h 2016-12-08 07:44:56 +01:00
btmrvl_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2017-07-05 12:31:59 -07:00
btmrvl_sdio.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
btmrvl_sdio.h btmrvl: add platform specific wakeup interrupt support 2016-05-02 19:26:15 +02:00
btqca.c Bluetooth: btqca: Fixed a coding style error 2017-07-20 11:18:35 +02:00
btqca.h
btqcomsmd.c Bluetooth: btqcomsmd: Fix skb double free corruption 2018-03-24 11:01:21 +01:00
btrtl.c Bluetooth: btrtl: Fix a error code in rtl_load_config() 2017-07-28 19:29:08 +03:00
btrtl.h
btsdio.c Bluetooth: btsdio: Do not bind to non-removable BCM43341 2018-02-16 20:23:06 +01:00
btuart_cs.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
btusb.c Bluetooth: btusb: add ID for LiteOn 04ca:301a 2018-08-03 07:50:32 +02:00
btwilink.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
dtl1_cs.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_ag6xx.c Bluetooth: hci_uart: Add diag and address support for Intel/AG6xx 2016-02-29 19:25:22 +02:00
hci_ath.c
hci_bcm.c Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low 2018-04-19 08:56:19 +02:00
hci_bcsp.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_h4.c Bluetooth: hci_uart: Fix uninitialized alignment value 2017-07-31 13:27:37 +03:00
hci_h5.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_intel.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
hci_ldisc.c Bluetooth: hci_ldisc: Allow sleeping while proto locks are held. 2018-08-15 18:12:49 +02:00
hci_ll.c Bluetooth: Style fix - align block comments 2017-07-22 08:39:39 +02:00
hci_mrvl.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
hci_nokia.c Bluetooth: hci_nokia: Use new hci_uart_unregister_device() function 2017-07-20 11:18:36 +02:00
hci_qca.c Bluetooth: hci_qca: Fix "Sleep inside atomic section" warning 2018-08-03 07:50:27 +02:00
hci_serdev.c Bluetooth: hci_serdev: Init hci_uart proto_lock to avoid oops 2018-08-15 18:12:49 +02:00
hci_uart.h Bluetooth: hci_ldisc: Allow sleeping while proto locks are held. 2018-08-15 18:12:49 +02:00
hci_vhci.c networking: add and use skb_put_u8() 2017-06-16 11:48:40 -04:00
Kconfig Bluetooth: BT_HCIUART now depends on SERIAL_DEV_BUS 2018-02-22 15:42:32 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00