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)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 2 Feb 2022 01:36:09 +0000 (17:36 -0800)
commit241026130c6cb6001e8f2bacf578ccfec6a56478
tree28cf154920fa48d1340aa4243796dc54e39fd62e
parent25c7e34ec8d2d1edd8b86c91c56e2d1d8178870b
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