* [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
@ 2022-01-25 18:53 Luiz Augusto von Dentz
2022-01-25 19:56 ` bluez.test.bot
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-01-25 18:53 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
HCI_EV_VENDOR is in fact variable length since it acts as metaevent
where a vendor can implement their own event sets.
In addition to it this makes use of bt_dev_warn_ratelimited to supress
the amount of logging in case the event has more data than expected.
Fixes: 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI event")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
net/bluetooth/hci_event.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 664ccf1d8d93..63b925921c87 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6844,7 +6844,7 @@ static const struct hci_ev {
HCI_EV(HCI_EV_NUM_COMP_BLOCKS, hci_num_comp_blocks_evt,
sizeof(struct hci_ev_num_comp_blocks)),
/* [0xff = HCI_EV_VENDOR] */
- HCI_EV(HCI_EV_VENDOR, msft_vendor_evt, 0),
+ HCI_EV_VL(HCI_EV_VENDOR, msft_vendor_evt, 0, HCI_MAX_EVENT_SIZE),
};
static void hci_event_func(struct hci_dev *hdev, u8 event, struct sk_buff *skb,
@@ -6869,8 +6869,9 @@ static void hci_event_func(struct hci_dev *hdev, u8 event, struct sk_buff *skb,
* decide if that is acceptable.
*/
if (skb->len > ev->max_len)
- bt_dev_warn(hdev, "unexpected event 0x%2.2x length: %u > %u",
- event, skb->len, ev->max_len);
+ bt_dev_warn_ratelimited(hdev,
+ "unexpected event 0x%2.2x length: %u > %u",
+ event, skb->len, ev->max_len);
data = hci_ev_skb_pull(hdev, skb, event, ev->min_len);
if (!data)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-01-25 18:53 [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len Luiz Augusto von Dentz
@ 2022-01-25 19:56 ` bluez.test.bot
2022-01-25 21:43 ` [PATCH] " Marcel Holtmann
2022-03-14 13:50 ` Mike Lothian
2 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2022-01-25 19:56 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1948 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=608383
---Test result---
Test Summary:
CheckPatch FAIL 0.93 seconds
GitLint PASS 0.37 seconds
SubjectPrefix PASS 0.21 seconds
BuildKernel PASS 39.46 seconds
BuildKernel32 PASS 34.88 seconds
Incremental Build with patchesPASS 45.99 seconds
TestRunner: Setup PASS 609.88 seconds
TestRunner: l2cap-tester PASS 16.01 seconds
TestRunner: bnep-tester PASS 7.20 seconds
TestRunner: mgmt-tester PASS 126.48 seconds
TestRunner: rfcomm-tester PASS 9.17 seconds
TestRunner: sco-tester PASS 9.29 seconds
TestRunner: smp-tester PASS 9.19 seconds
TestRunner: userchan-tester PASS 7.58 seconds
Details
##############################
Test: CheckPatch - FAIL - 0.93 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len\WARNING:TYPO_SPELLING: 'supress' may be misspelled - perhaps 'suppress'?
#83:
In addition to it this makes use of bt_dev_warn_ratelimited to supress
^^^^^^^
total: 0 errors, 1 warnings, 0 checks, 19 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/12724153.patch has style problems, please review.
NOTE: Ignored message types: UNKNOWN_COMMIT_ID
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-01-25 18:53 [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len Luiz Augusto von Dentz
2022-01-25 19:56 ` bluez.test.bot
@ 2022-01-25 21:43 ` Marcel Holtmann
2022-03-14 13:50 ` Mike Lothian
2 siblings, 0 replies; 7+ messages in thread
From: Marcel Holtmann @ 2022-01-25 21:43 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
> HCI_EV_VENDOR is in fact variable length since it acts as metaevent
> where a vendor can implement their own event sets.
>
> In addition to it this makes use of bt_dev_warn_ratelimited to supress
> the amount of logging in case the event has more data than expected.
>
> Fixes: 3e54c5890c87 ("Bluetooth: hci_event: Use of a function table to handle HCI event")
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/hci_event.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-01-25 18:53 [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len Luiz Augusto von Dentz
2022-01-25 19:56 ` bluez.test.bot
2022-01-25 21:43 ` [PATCH] " Marcel Holtmann
@ 2022-03-14 13:50 ` Mike Lothian
2022-03-14 17:30 ` Luiz Augusto von Dentz
2 siblings, 1 reply; 7+ messages in thread
From: Mike Lothian @ 2022-03-14 13:50 UTC (permalink / raw)
To: luiz.dentz; +Cc: linux-bluetooth
Hi
I've only just noticed this patch solves my issue
https://lore.kernel.org/netdev/20220125144639.2226-1-mike@fireburn.co.uk/
Can it be added to stable too?
My patch can then be ignored:
https://patchwork.kernel.org/project/bluetooth/patch/20220312164550.1810665-1-mike@fireburn.co.uk/
Thanks
Mike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-03-14 13:50 ` Mike Lothian
@ 2022-03-14 17:30 ` Luiz Augusto von Dentz
2022-03-14 18:31 ` Mike Lothian
0 siblings, 1 reply; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-03-14 17:30 UTC (permalink / raw)
To: Mike Lothian; +Cc: linux-bluetooth
Hi Mike,
On Mon, Mar 14, 2022 at 6:50 AM Mike Lothian <mike@fireburn.co.uk> wrote:
>
> Hi
>
> I've only just noticed this patch solves my issue
>
> https://lore.kernel.org/netdev/20220125144639.2226-1-mike@fireburn.co.uk/
>
> Can it be added to stable too?
>
> My patch can then be ignored:
>
> https://patchwork.kernel.org/project/bluetooth/patch/20220312164550.1810665-1-mike@fireburn.co.uk/
>
> Thanks
>
> Mike
We fixed this a while back:
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/net/bluetooth/hci_event.c?id=314d8cd2787418c5ac6b02035c344644f47b292b
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-03-14 17:30 ` Luiz Augusto von Dentz
@ 2022-03-14 18:31 ` Mike Lothian
2022-03-14 20:09 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 7+ messages in thread
From: Mike Lothian @ 2022-03-14 18:31 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
On Mon, 14 Mar 2022 at 17:30, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
>
> We fixed this a while back:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/net/bluetooth/hci_event.c?id=314d8cd2787418c5ac6b02035c344644f47b292b
>
> --
> Luiz Augusto von Dentz
Yes, and it looks like that commit is queued for kernel 5.18. I was
hoping you could get it added into 5.17 where I'm seeing spurious
messages during boot, before it's released
Thanks
Mike
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len
2022-03-14 18:31 ` Mike Lothian
@ 2022-03-14 20:09 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-03-14 20:09 UTC (permalink / raw)
To: Mike Lothian; +Cc: linux-bluetooth, Marcel Holtmann
Hi Marcel,
On Mon, Mar 14, 2022 at 11:31 AM Mike Lothian <mike@fireburn.co.uk> wrote:
>
> On Mon, 14 Mar 2022 at 17:30, Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> >
> > We fixed this a while back:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/net/bluetooth/hci_event.c?id=314d8cd2787418c5ac6b02035c344644f47b292b
> >
> > --
> > Luiz Augusto von Dentz
>
> Yes, and it looks like that commit is queued for kernel 5.18. I was
> hoping you could get it added into 5.17 where I'm seeing spurious
> messages during boot, before it's released
>
Can we perhaps merge it to bluetooth.git so we send a pr to be included in 5.17?
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-03-14 20:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-25 18:53 [PATCH] Bluetooth: hci_event: Fix HCI_EV_VENDOR max_len Luiz Augusto von Dentz
2022-01-25 19:56 ` bluez.test.bot
2022-01-25 21:43 ` [PATCH] " Marcel Holtmann
2022-03-14 13:50 ` Mike Lothian
2022-03-14 17:30 ` Luiz Augusto von Dentz
2022-03-14 18:31 ` Mike Lothian
2022-03-14 20:09 ` Luiz Augusto von Dentz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.