linux/drivers
Ivan Pravdin ca94b2b036 Bluetooth: bcsp: receive data only if registered
Currently, bcsp_recv() can be called even when the BCSP protocol has not
been registered. This leads to a NULL pointer dereference, as shown in
the following stack trace:

    KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f]
    RIP: 0010:bcsp_recv+0x13d/0x1740 drivers/bluetooth/hci_bcsp.c:590
    Call Trace:
     <TASK>
     hci_uart_tty_receive+0x194/0x220 drivers/bluetooth/hci_ldisc.c:627
     tiocsti+0x23c/0x2c0 drivers/tty/tty_io.c:2290
     tty_ioctl+0x626/0xde0 drivers/tty/tty_io.c:2706
     vfs_ioctl fs/ioctl.c:51 [inline]
     __do_sys_ioctl fs/ioctl.c:907 [inline]
     __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f

To prevent this, ensure that the HCI_UART_REGISTERED flag is set before
processing received data. If the protocol is not registered, return
-EUNATCH.

Reported-by: syzbot+4ed6852d4da4606c93da@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4ed6852d4da4606c93da
Tested-by: syzbot+4ed6852d4da4606c93da@syzkaller.appspotmail.com
Signed-off-by: Ivan Pravdin <ipravdin.official@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2025-09-27 11:37:02 -04:00
..
accel
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block block-6.17-20250918 2025-09-19 12:26:20 -07:00
bluetooth Bluetooth: bcsp: receive data only if registered 2025-09-27 11:37:02 -04:00
bus
cache
cdrom
cdx
char
clk Allwinner Clock Fixes for 6.17 2025-09-19 21:28:01 -07:00
clocksource
comedi
connector
counter
cpufreq cpufreq: Initialize cpufreq-based invariance before subsys 2025-09-20 13:00:20 +02:00
cpuidle
crypto
cxl
dax
dca
devfreq
dibs dibs: Check correct variable in dibs_init() 2025-09-26 15:10:59 -07:00
dio
dma
dma-buf
dpll dpll: zl3073x: Fix double free in zl3073x_devlink_flash_update() 2025-09-26 15:23:55 -07:00
edac
eisa
extcon
firewire firewire: core: fix overlooked update of subsystem ABI version 2025-09-20 12:17:50 +09:00
firmware soc: fixes for 6.17, part 3 2025-09-24 14:37:44 -07:00
fpga
fsi
fwctl
gnss
gpio intel-gpio for v6.17-1 2025-09-16 11:36:37 +02:00
gpu amd-drm-fixes-6.17-2025-09-18: 2025-09-19 12:35:09 +10:00
greybus
hid hid-for-linus-2025092201 2025-09-22 11:01:37 -07:00
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-09-25 11:00:59 -07:00
input
interconnect
iommu iommufd 6.17 second rc pull 2025-09-22 11:16:14 -07:00
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md block-6.17-20250918 2025-09-19 12:26:20 -07:00
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net octeon_ep_vf: Add support to retrieve hardware channel information 2025-09-26 17:43:24 -07:00
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform platform-drivers-x86 for v6.17-4 2025-09-18 09:22:34 -07:00
pmdomain
pnp
power
powercap
pps
ps3
ptp ptp_ocp: make ptp_ocp driver compatible with PTP_EXTTS_REQUEST2 2025-09-19 17:00:06 -07:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 dibs: Move event handling to dibs layer 2025-09-23 11:13:22 +02:00
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost vhost-net: flush batched before enabling notifications 2025-09-19 04:15:26 -04:00
video
virt
virtio
w1
watchdog
xen
zorro
Kconfig
Makefile dibs: Create drivers/dibs 2025-09-23 11:13:21 +02:00