WSL2-Linux-Kernel/drivers
Dean Jenkins 048e1bd3a2 Bluetooth: hci_ldisc: Add protocol check to hci_uart_dequeue()
Before attempting to dequeue a Data Link protocol encapsulated message,
check that the Data Link protocol is still bound to the HCI UART driver.
This makes the code consistent with the usage of the other proto
function pointers.

Therefore, add a check for HCI_UART_PROTO_READY into hci_uart_dequeue()
and return NULL if the Data Link protocol is not bound.

This is needed for robustness as there is a scheduling race condition.
hci_uart_write_work() is scheduled to run via work queue hu->write_work
from hci_uart_tx_wakeup(). Therefore, there is a delay between
scheduling hci_uart_write_work() to run and hci_uart_dequeue() running
whereby the Data Link protocol layer could become unbound during the
scheduling delay. In this case, without the check, the call to the
unbound Data Link protocol layer dequeue function can crash.

It is noted that hci_uart_tty_close() has a
"cancel_work_sync(&hu->write_work)" statement but this only reduces
the window of the race condition because it is possible for a new
work-item to be added to work queue hu->write_work after the call to
cancel_work_sync(). For example, Data Link layer retransmissions can
be added to the work queue after the cancel_work_sync() has finished.

Signed-off-by: Dean Jenkins <Dean_Jenkins@mentor.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2017-04-30 12:22:14 +02:00
..
accessibility
acpi ACPI / power: Avoid maybe-uninitialized warning 2017-04-19 22:46:10 +02:00
amba
android sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ata sata_via: Enable hotplug only on VT6421 2017-04-11 09:12:18 +09:00
atm ambassador: use setup_timer 2017-03-12 23:47:16 -07:00
auxdisplay auxdisplay: img-ascii-lcd: add missing sentinel entry in img_ascii_lcd_matches 2017-03-16 16:59:55 +09:00
base drivers core: remove assert_held_device_hotplug() 2017-03-16 16:56:19 -07:00
bcma bcma: fill core OF info independently of bus type 2017-03-20 19:12:01 +02:00
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-21 20:23:53 -07:00
bluetooth Bluetooth: hci_ldisc: Add protocol check to hci_uart_dequeue() 2017-04-30 12:22:14 +02:00
bus ARM: SoC driver updates 2017-02-23 15:57:04 -08:00
cdrom Merge branch 'for-4.11/next' into for-4.11/linus-merge 2017-02-17 14:08:19 -07:00
char Fixes /dev/mem to read back zeros for System RAM areas in the 1MB exception 2017-04-14 08:57:20 -07:00
clk Allwinner clock fixes for 4.11 2017-04-17 11:04:12 -07:00
clocksource Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-04-02 09:22:03 -07:00
connector
cpufreq cpufreq: Bring CPUs up even if cpufreq_online() failed 2017-04-13 03:38:44 +02:00
cpuidle cpuidle: powernv: Pass correct drv->cpumask for registration 2017-03-29 22:55:36 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2017-04-10 09:37:43 -07:00
dax device-dax: switch to srcu, fix rcu_read_lock() vs pte allocation 2017-04-12 13:45:18 -07:00
dca
devfreq scripts/spelling.txt: add "followings" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
dio
dma dmaengine: Fix array index out of bounds warning in __get_unmap_pool() 2017-03-14 10:11:27 +05:30
dma-buf sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
edac EDAC, pnd2_edac: Fix reported DIMM number 2017-03-26 09:36:28 +02:00
eisa
extcon extcon: int3496: Set the id pin to direction-input if necessary 2017-03-22 18:29:48 +09:00
firewire Merge branch 'idr-4.11' of git://git.infradead.org/users/willy/linux-dax 2017-02-28 20:29:41 -08:00
firmware efi/libstub: Skip GOP with PIXEL_BLT_ONLY format 2017-04-05 09:20:18 +02:00
fmc
fpga fpga zynq: Use the scatterlist interface 2017-02-10 15:20:44 +01:00
fsi drivers/fsi: add driver to device matches 2017-02-10 15:19:48 +01:00
gpio ACPI / gpio: do not fall back to parsing _CRS when we get a deferral 2017-03-30 11:08:46 +02:00
gpu Merge branch 'linux-4.11' of git://github.com/skeggsb/linux into drm-fixes 2017-04-13 09:56:05 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2017-04-20 12:26:10 -07:00
hsi sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
hv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-06 08:24:51 -07:00
hwmon hwmon: (asus_atk0110) fix uninitialized data access 2017-03-23 12:01:57 -07:00
hwspinlock
hwtracing intel_th: pci: Add Gemini Lake support 2017-03-15 14:55:18 +02:00
i2c i2c: mux: pca954x: Add missing pca9546 definition to chip_desc 2017-03-24 12:22:18 +01:00
ide sched/headers: Prepare for new header dependencies before moving code to <linux/sched/task_stack.h> 2017-03-02 08:42:36 +01:00
idle Power management turbostat utility updates for v4.11-rc1 2017-03-02 17:41:27 -08:00
iio iio: hid-sensor-attributes: Fix sensor property setting failure. 2017-04-02 11:44:03 +01:00
infiniband hw/mlx5: Add New bit to check over QP creation 2017-04-17 11:08:32 -04:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2017-04-21 09:13:43 -07:00
iommu Merge branch 'for-joerg/arm-smmu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into iommu/fixes 2017-03-22 23:59:56 +01:00
ipack
irqchip irqchip/irq-imx-gpcv2: Fix spinlock initialization 2017-04-14 10:55:05 +02:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-06 08:24:51 -07:00
leds sched/headers: Prepare for new header dependencies before moving code to <linux/sched/loadavg.h> 2017-03-02 08:42:27 +01:00
lguest sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
lightnvm lightnvm: set default lun range when no luns are specified 2017-02-15 08:27:21 -07:00
macintosh powerpc/pmac: Fix crash in dma-mapping.h with NULL dma_ops 2017-03-10 14:17:23 +11:00
mailbox sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
mcb
md Merge branch 'for-linus' of git://git.kernel.dk/linux-block 2017-04-08 11:56:58 -07:00
media media fixes for v4.11-rc4 2017-03-24 13:34:16 -07:00
memory Linux 4.11-rc1 2017-03-06 08:37:53 -08:00
memstick Merge branch 'for-4.11/next' into for-4.11/linus-merge 2017-02-17 14:08:19 -07:00
message SCSI misc on 20170220 2017-02-21 11:51:42 -08:00
mfd staging/iio driver patches for 4.11-rc1 2017-02-22 12:14:01 -08:00
misc Char/Misc driver fixes for 4.11-rc4 2017-03-26 11:15:54 -07:00
mmc mmc: sdhci-esdhc-imx: increase the pad I/O drive strength for DDR50 card 2017-04-20 14:41:05 +02:00
mtd scripts/spelling.txt: add "disble(d)" pattern and fix typo instances 2017-03-09 17:01:09 -08:00
net qlcnic: fix unchecked return value 2017-04-24 16:10:53 -04:00
nfc nfc: fix get_unaligned_...() misuses 2017-04-17 00:42:22 +02:00
ntb ntb: ntb_hw_intel: link_poll isn't clearing the pending status properly 2017-02-16 23:11:26 -05:00
nubus
nvdimm libnvdimm: band aid btt vs clear poison locking 2017-04-10 17:21:45 -07:00
nvme nvme: Quirk APST off on "THNSF5256GPUK TOSHIBA" 2017-04-20 14:42:10 -06:00
nvmem
of mdio_bus: Issue GPIO RESET to PHYs. 2017-04-24 12:40:24 -04:00
oprofile sched/headers: Prepare to move the get_task_struct()/put_task_struct() and related APIs from <linux/sched.h> to <linux/sched/task.h> 2017-03-02 08:42:40 +01:00
parisc Merge branch 'parisc-4.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux 2017-03-03 16:20:06 -08:00
parport parport: fix attempt to write duplicate procfiles 2017-03-16 17:32:21 +09:00
pci Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-21 20:23:53 -07:00
pcmcia
perf sched/headers: Prepare for new header dependencies before moving code to <linux/sched/clock.h> 2017-03-02 08:42:27 +01:00
phy phy: qcom-usb-hs: Add depends on EXTCON 2017-03-09 15:29:57 +05:30
pinctrl pinctrl: cherryview: Add a quirk to make Acer Chromebook keyboard work again 2017-04-11 10:09:39 +02:00
platform platform-drivers-x86 for v4.11-2 2017-03-13 13:23:43 -07:00
pnp
power scripts/spelling.txt: add "intialization" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
powercap
pps
ps3 sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
ptp PTP: fix ptr_ret.cocci warnings 2017-03-20 16:25:06 +01:00
pwm pwm: rockchip: State of PWM clock should synchronize with PWM enabled state 2017-04-06 15:08:52 +02:00
rapidio drivers/rapidio/devices/tsi721.c: make module parameter variable name unique 2017-03-31 17:13:30 -07:00
ras
regulator regulator: Updates for v4.11 2017-02-20 17:23:57 -08:00
remoteproc soc: qcom: smd: Remove standalone driver 2017-03-28 17:58:07 -07:00
reset reset: add exported __reset_control_get, return NULL if optional 2017-04-04 17:36:10 +02:00
rpmsg soc: qcom: smd: Remove standalone driver 2017-03-28 17:58:07 -07:00
rtc sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
s390 s390/qeth: remove unimplemented gdev routines 2017-04-11 14:51:35 -04:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-20 10:35:33 -04:00
sfi
sh
sn
soc soc: qcom: smd-rpm: Add msm8996 compatibility 2017-03-28 17:58:08 -07:00
spi sched/headers: Prepare for new header dependencies before moving code to <uapi/linux/sched/types.h> 2017-03-02 08:42:27 +01:00
spmi
ssb
staging My last pull request has been a while, we now have: 2017-04-20 13:54:40 -04:00
target tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case 2017-04-02 16:18:51 -07:00
tc
thermal thermal: cpu_cooling: Check OPP for errors 2017-03-13 10:06:55 +08:00
thunderbolt
tty Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-20 10:35:33 -04:00
uio sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-04-15 21:16:30 -04:00
uwb uwb: i1480-dfu: fix NULL-deref at probe 2017-03-14 17:07:31 +08:00
vfio VFIO fixes for v4.11-rc4 2017-03-24 14:39:36 -07:00
vhost VSOCK: Add virtio vsock vsockmon hooks 2017-04-24 12:35:56 -04:00
video backlight: pwm_bl: Fix GPIO out for unimplemented .get_direction() 2017-04-19 19:59:44 +01:00
virt
virtio virtio-pci: Remove affinity hint before freeing the interrupt 2017-04-11 00:30:20 +03:00
vlynq
vme
w1 sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
watchdog watchdog: retu: restore MFD dependency 2017-03-01 06:15:10 -08:00
xen xenbus: remove transaction holder from list before freeing 2017-04-04 10:11:06 -04:00
zorro
Kconfig drivers/fsi: Add empty fsi bus definitions 2017-02-10 15:19:48 +01:00
Makefile pci-v4.11-changes 2017-02-23 11:53:22 -08:00