Lee Jones b1a37ed00d HID: core: Provide new max_buffer_size attribute to over-ride the default
Presently, when a report is processed, its proposed size, provided by
the user of the API (as Report Size * Report Count) is compared against
the subsystem default HID_MAX_BUFFER_SIZE (16k).  However, some
low-level HID drivers allocate a reduced amount of memory to their
buffers (e.g. UHID only allocates UHID_DATA_MAX (4k) buffers), rending
this check inadequate in some cases.

In these circumstances, if the received report ends up being smaller
than the proposed report size, the remainder of the buffer is zeroed.
That is, the space between sizeof(csize) (size of the current report)
and the rsize (size proposed i.e. Report Size * Report Count), which can
be handled up to HID_MAX_BUFFER_SIZE (16k).  Meaning that memset()
shoots straight past the end of the buffer boundary and starts zeroing
out in-use values, often resulting in calamity.

This patch introduces a new variable into 'struct hid_ll_driver' where
individual low-level drivers can over-ride the default maximum value of
HID_MAX_BUFFER_SIZE (16k) with something more sympathetic to the
interface.

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-02-23 11:51:56 +01:00
2023-02-22 11:01:17 -08:00
2023-02-21 18:24:12 -08:00
2023-02-22 11:24:42 -08:00
2023-02-21 18:24:12 -08:00
2023-02-21 18:24:12 -08:00
2023-02-20 14:27:21 -08:00
2023-02-21 18:24:12 -08:00
2023-02-21 18:24:12 -08:00
2023-02-22 11:24:42 -08:00
2023-02-20 10:40:42 -08:00
2023-02-22 11:24:42 -08:00
2023-02-21 18:24:12 -08:00
2023-02-22 10:29:05 -08:00
2023-02-22 11:24:42 -08:00
2023-01-23 11:56:07 -08:00
2022-12-14 09:15:43 -08:00
2022-12-30 17:22:14 +09:00
2022-09-28 09:02:20 +02:00
2023-02-02 11:35:33 -08:00
2022-10-10 12:00:45 -07:00
2023-02-22 11:24:42 -08:00
2023-02-20 10:40:42 -08:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
The linux-next integration testing tree
Readme 3.7 GiB
Languages
C 97.5%
Assembly 1%
Shell 0.6%
Python 0.3%
Makefile 0.3%