Re: [PATCH] Bluetooth: hci_ldisc: Initialize hci_dev before open()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeremy,

> The hci_dev struct hdev is referenced in work queues and timers started
> by open() in some protocols. This creates a race between the
> initialization function and the work or timer which can result hdev
> being dereferenced while it is still null.
> 
> The syzbot report contains a reliable reproducer which causes a null
> pointer dereference of hdev in hci_uart_write_work() by making the
> memory allocation for hdev fail.
> 
> To fix this, ensure hdev is valid from before calling a protocol's
> open() until after calling a protocol's close().
> 
> Reported-by: syzbot+257790c15bcdef6fe00c@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Jeremy Cline <jcline@xxxxxxxxxx>
> ---
> drivers/bluetooth/hci_ldisc.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux