Bluetooth: hci_uart: fix GPF in h5_recv
authorPavel Skripkin <paskripkin@gmail.com>
Thu, 2 Sep 2021 20:27:56 +0000 (23:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:23 +0000 (19:16 +0100)
commit3998e06d9511d639892f9f515c3a50f7591ff1ba
treeee577eedc4e4f0c84ce2330e96969f982b168abe
parent9fc04208643f8ccedf1195e41f9c26ca9621bb90
Bluetooth: hci_uart: fix GPF in h5_recv

[ Upstream commit 2fc7acb69fa3573d4bf7a90c323296d840daf330 ]

Syzbot hit general protection fault in h5_recv(). The problem was in
missing NULL check.

hu->serdev can be NULL and we cannot blindly pass &serdev->dev
somewhere, since it can cause GPF.

Fixes: d9dd833cf6d2 ("Bluetooth: hci_h5: Add runtime suspend")
Reported-and-tested-by: syzbot+7d41312fe3f123a6f605@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/hci_h5.c