2019-04-03 06:46:37

by Jaganath K

[permalink] [raw]
Subject: [PATCH] Bluetooth: Fix incorrect pointer arithmatic in ext_adv_report_evt

In ext_adv_report_event rssi comes before data (not after data as
in legacy adv_report_evt) so "+ 1" is not required in the ptr arithmatic
to point to next report.

Signed-off-by: Jaganath Kanakkassery <[email protected]>
---
net/bluetooth/hci_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 609fd68..66b631a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5433,7 +5433,7 @@ static void hci_le_ext_adv_report_evt(struct hci_dev *hdev, struct sk_buff *skb)
ev->data, ev->length);
}

- ptr += sizeof(*ev) + ev->length + 1;
+ ptr += sizeof(*ev) + ev->length;
}

hci_dev_unlock(hdev);
--
2.7.4



2019-04-23 17:23:59

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix incorrect pointer arithmatic in ext_adv_report_evt

Hi Jaganath,

> In ext_adv_report_event rssi comes before data (not after data as
> in legacy adv_report_evt) so "+ 1" is not required in the ptr arithmatic
> to point to next report.
>
> Signed-off-by: Jaganath Kanakkassery <[email protected]>
> ---
> net/bluetooth/hci_event.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel