diff options
author | Loic Poulain <loic.poulain@intel.com> | 2014-06-23 17:42:44 +0200 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-07-29 16:45:42 +0200 |
commit | 5233db8579572080c4ec3edf0aacd843ec6707d8 (patch) | |
tree | 5dcfd8820f2bb588fac3bd3348eafd8e89fd7317 | |
parent | 65769bee8f02c6f0d22211732030ae7c62358862 (diff) | |
download | lwn-5233db8579572080c4ec3edf0aacd843ec6707d8.tar.gz lwn-5233db8579572080c4ec3edf0aacd843ec6707d8.zip |
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 <loic.poulain@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | drivers/bluetooth/hci_h5.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index b6154d5a07a5..db0be2fb05fe 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; |