OSDN Git Service

Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected()
authorRadoslaw Biernacki <rad@semihalf.com>
Tue, 1 Feb 2022 20:10:32 +0000 (20:10 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 4 Mar 2022 15:10:49 +0000 (16:10 +0100)
commitba17bb62ce415950753c19d16bb43b2bd3701158
treec0a044ebf28c3a2ad141c6db786f75a77e4c8ad1
parenta6fbb2bf51adc117e7d4030e4fd55f0763ab890d
Bluetooth: Fix skb allocation in mgmt_remote_name() & mgmt_device_connected()

This patch fixes skb allocation, as lack of space for ev might push skb
tail beyond its end.
Also introduce eir_precalc_len() that can be used instead of magic
numbers for similar eir operations on skb.

Fixes: cf1bce1de7eeb ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_FOUND")
Fixes: e96741437ef0a ("Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED")
Signed-off-by: Angela Czubak <acz@semihalf.com>
Signed-off-by: Marek Maslanka <mm@semihalf.com>
Signed-off-by: Radoslaw Biernacki <rad@semihalf.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/eir.h
net/bluetooth/mgmt.c