]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: Fix eir name length
authorFrédéric Danis <frederic.danis@collabora.com>
Thu, 7 Mar 2024 16:42:05 +0000 (17:42 +0100)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:39 +0000 (18:19 -0400)
commit6dda052ee1e5d57c4fe70d425a05677f7af832ad
tree0e507bc416994979f1a4aaa10c8a4ebc1a27a1a4
parent9017a4f374379a9486c0e26af67a92e3a37593df
Bluetooth: Fix eir name length

[ Upstream commit 2ab3e8d67fc1d4a7638b769cf83023ec209fc0a9 ]

According to Section 1.2 of Core Specification Supplement Part A the
complete or short name strings are defined as utf8s, which should not
include the trailing NULL for variable length array as defined in Core
Specification Vol1 Part E Section 2.9.3.

Removing the trailing NULL allows PTS to retrieve the random address based
on device name, e.g. for SM/PER/KDU/BV-02-C, SM/PER/KDU/BV-08-C or
GAP/BROB/BCST/BV-03-C.

Fixes: f61851f64b17 ("Bluetooth: Fix append max 11 bytes of name to scan rsp data")
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/eir.c
net/bluetooth/mgmt.c