All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian <seb.witt@googlemail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Sebastian <seb.witt@googlemail.com>
Subject: [PATCH v3 4/6] input/hog: Accept Report Map longer than 512 octets
Date: Thu,  3 Dec 2026 16:34:06 +0100	[thread overview]
Message-ID: <20261203153408.31769-5-seb.witt@googlemail.com> (raw)
In-Reply-To: <20261203153408.31769-1-seb.witt@googlemail.com>

Some HID over GATT devices expose a Report Map longer than 512 octets,
such as the Inateck KB05113 keyboard with touchpad (3373:7713), which
sends 637 octets. Since 5.88 it is truncated when read, the kernel then
fails to parse it and no input device is created:

  hid-generic 0005:3373:7713.0005: item fetching failed at offset 509/512
  hid-generic 0005:3373:7713.0005: probe with driver hid-generic failed

Other Inateck keyboards, the HP 720 keyboard and the Sanwa MA-PB521GM
touchpad, with Report Maps of 612 to 902 octets, are reported to fail
the same way.

This is a regression: commit 952c08ff50c5 ("hog-lib: Don't restrict
Report MAP size") made hog-lib read Report Maps of any size, since other
operating systems don't enforce the limit and many devices exceed it.
Since commit 96f1201f5ac2 ("input/hog: Use shared/hog") the Report Map
is read with bt_gatt_client_read_value, which truncates to
BT_ATT_MAX_VALUE_LEN.

Accept them according to the LongReportMap option of [Input] in
main.conf, which is enabled unless Testing is.

Fixes: 96f1201f5ac2 ("input/hog: Use shared/hog")
Closes: https://github.com/bluez/bluez/issues/2814
---
 profiles/input/hog.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/profiles/input/hog.c b/profiles/input/hog.c
index 0f6224990..b7c293eee 100644
--- a/profiles/input/hog.c
+++ b/profiles/input/hog.c
@@ -29,6 +29,7 @@
 #include "bluetooth/uuid.h"
 
 #include "src/log.h"
+#include "src/btd.h"
 #include "src/adapter.h"
 #include "src/device.h"
 #include "src/profile.h"
@@ -81,8 +82,11 @@ static void hog_device_accept(struct hog_device *dev, struct gatt_db *db)
 							product, version);
 
 	dev->hog = bt_hog_new_default(name, vendor, product, version, type, db);
-	if (dev->hog)
-		bt_hog_set_debug(dev->hog, hog_debug, NULL, NULL);
+	if (!dev->hog)
+		return;
+
+	bt_hog_set_debug(dev->hog, hog_debug, NULL, NULL);
+	bt_hog_set_long_report_map(dev->hog, btd_opts.input.long_report_map);
 }
 
 static struct hog_device *hog_device_new(struct btd_device *device)
-- 
2.56.1


  parent reply	other threads:[~2026-12-03 15:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABBYNZ+GNO-eVNC5B_4SqCdHOE+OHmXUaW0NwStd_BsbUzx35A@mail.gmail.com>
2026-11-30 20:45 ` [PATCH v2 0/4] Accept HoG Report Map longer than 512 octets Sebastian
2026-11-30 20:45   ` [PATCH v2 1/4] shared/gatt-client: Add bt_gatt_client_read_long_value_max_len Sebastian
2026-12-01  0:02     ` Accept HoG Report Map longer than 512 octets bluez.test.bot
2026-12-02 16:13       ` Luiz Augusto von Dentz
2026-12-03 18:16         ` Sebastian Witt
2026-11-30 20:45   ` [PATCH v2 2/4] main.conf: Add LongReportMap option to [Input] Sebastian
2026-11-30 20:45   ` [PATCH v2 3/4] shared/hog: Add bt_hog_set_long_report_map Sebastian
2026-11-30 20:45   ` [PATCH v2 4/4] input/hog: Accept Report Map longer than 512 octets Sebastian
2026-12-03 15:34 ` [PATCH v3 0/6] Accept HoG " Sebastian
2026-12-03 15:34   ` [PATCH v3 1/6] shared/gatt-client: Add bt_gatt_client_read_long_value_max_len Sebastian
2026-12-03 17:56     ` Accept HoG Report Map longer than 512 octets bluez.test.bot
2026-12-03 15:34   ` [PATCH v3 2/6] main.conf: Add LongReportMap option to [Input] Sebastian
2026-12-03 15:34   ` [PATCH v3 3/6] shared/hog: Add bt_hog_set_long_report_map Sebastian
2026-12-03 15:34   ` Sebastian [this message]
2026-12-03 15:34   ` [PATCH v3 5/6] unit/test-gatt: Add tests for long reads beyond 512 octets Sebastian
2026-12-03 15:34   ` [PATCH v3 6/6] unit/test-hog: Add tests for long Report Map Sebastian
2026-12-03 20:30   ` [PATCH v3 0/6] Accept HoG Report Map longer than 512 octets patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261203153408.31769-5-seb.witt@googlemail.com \
    --to=seb.witt@googlemail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.