diff options
| author | Benjamin Tissoires <bentiss@kernel.org> | 2026-05-04 11:47:23 +0300 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.com> | 2026-05-12 19:03:58 +0300 |
| commit | 206342541fc887ae919774a43942dc883161fece (patch) | |
| tree | cd810e3f74b34c20bce0ffddc24afc0b4d5c47d6 /include/linux | |
| parent | 2c85c61d1332e1e16f020d76951baf167dcb6f7a (diff) | |
| download | linux-206342541fc887ae919774a43942dc883161fece.tar.xz | |
HID: core: introduce hid_safe_input_report()
hid_input_report() is used in too many places to have a commit that
doesn't cross subsystem borders. Instead of changing the API, introduce
a new one when things matters in the transport layers:
- usbhid
- i2chid
This effectively revert to the old behavior for those two transport
layers.
Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hid.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/hid.h b/include/linux/hid.h index ac432a2ef415..bfb9859f391e 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1030,6 +1030,8 @@ struct hid_field *hid_find_field(struct hid_device *hdev, unsigned int report_ty int hid_set_field(struct hid_field *, unsigned, __s32); int hid_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, u32 size, int interrupt); +int hid_safe_input_report(struct hid_device *hid, enum hid_report_type type, u8 *data, + size_t bufsize, u32 size, int interrupt); struct hid_field *hidinput_get_led_field(struct hid_device *hid); unsigned int hidinput_count_leds(struct hid_device *hid); __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); |
