From: Loic Poulain Date: Mon, 23 Jun 2014 15:42:44 +0000 (+0200) Subject: Bluetooth: Ignore H5 non-link packets in non-active state X-Git-Tag: submit/tizen/20160422.055611~1^2~99^2~18^2~810 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32c24ed1f0b34c1c05df46029eccef426b20f3e5;p=sdk%2Femulator%2Femulator-kernel.git Bluetooth: Ignore H5 non-link packets in non-active state commit 48439d501e3d9e8634bdc0c418e066870039599d upstream. When detecting a non-link packet, h5_reset_rx() frees the Rx skb. Not returning after that will cause the upcoming h5_rx_payload() call to dereference a now NULL Rx skb and trigger a kernel oops. Signed-off-by: Loic Poulain Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index f6f497450560..e36a0245f2c1 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -406,6 +406,7 @@ static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c) H5_HDR_PKT_TYPE(hdr) != HCI_3WIRE_LINK_PKT) { BT_ERR("Non-link packet received in non-active state"); h5_reset_rx(h5); + return 0; } h5->rx_func = h5_rx_payload;