Skip to contentSkip to conversation

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

PATCH New Marcel Holtmann 1 participant 1 message Apr 17, 2015

Subsystems (4)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 net/bluetooth/hidp/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/bluetooth/hidp/core.c +2 -1
index a05b9dbf14c9..9070dfd6b4ad 100644
@@ -1313,7 +1313,8 @@ int hidp_connection_add(struct hidp_connadd_req *req,
 			struct socket *ctrl_sock,
 			struct socket *intr_sock)
 {
-	u32 valid_flags = 0;
+	u32 valid_flags = BIT(HIDP_VIRTUAL_CABLE_UNPLUG) |
+			  BIT(HIDP_BOOT_PROTOCOL_MODE);
 	struct hidp_session *session;
 	struct l2cap_conn *conn;
 	struct l2cap_chan *chan;
Signature · 1 line
2.1.0