Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: hidp: Fix regression with older userspace and flags validation

While it is not used by newer userspace anymore, the older userspace was
utilizing HIDP_VIRTUAL_CABLE_UNPLUG and HIDP_BOOT_PROTOCOL_MODE flags
when adding a new HIDP connection.

The flags validation is important, but we can not break older userspace
and with that allow providing these flags even if newer userspace does
not use them anymore.

Reported-and-tested-by: Jörg Otte <jrg.otte@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Marcel Holtmann and committed by
Linus Torvalds
1f5014d6 75052566

+2 -1
+2 -1
net/bluetooth/hidp/core.c
··· 1313 1313 struct socket *ctrl_sock, 1314 1314 struct socket *intr_sock) 1315 1315 { 1316 - u32 valid_flags = 0; 1316 + u32 valid_flags = BIT(HIDP_VIRTUAL_CABLE_UNPLUG) | 1317 + BIT(HIDP_BOOT_PROTOCOL_MODE); 1317 1318 struct hidp_session *session; 1318 1319 struct l2cap_conn *conn; 1319 1320 struct l2cap_chan *chan;