linux/include
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
..
acpi ACPI updates for 6.3-rc1 2023-02-21 12:23:24 -08:00
asm-generic gpio updates for v6.3 2023-02-22 11:01:17 -08:00
clocksource
crypto crypto: api - Use data directly in completion function 2023-02-13 18:35:14 +08:00
drm drm/client: fix circular reference counting issue 2023-02-07 09:42:56 +01:00
dt-bindings Core changes: 2023-02-22 11:05:56 -08:00
keys
kunit kunit: fix kunit_test_init_section_suites(...) 2023-01-31 09:10:38 -07:00
kvm KVM: arm64: Add helper vgic_write_guest_lock() 2023-01-29 18:46:11 +00:00
linux HID: core: Provide new max_buffer_size attribute to over-ride the default 2023-02-23 11:51:56 +01:00
math-emu
media platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
memory
misc
net page_pool: add a comment explaining the fragment counter usage 2023-02-21 09:15:39 -08:00
pcmcia
ras
rdma
rv
scsi
soc net: mscc: ocelot: un-export unused regmap symbols 2023-02-06 22:33:15 -08:00
sound sound updates for 6.3-rc1 2023-02-22 10:29:05 -08:00
target
trace Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
uapi sound updates for 6.3-rc1 2023-02-22 10:29:05 -08:00
ufs
vdso vdso/bits.h: Add BIT_ULL() for the sake of consistency 2023-01-31 14:42:10 +01:00
video fbdev: remove w100fb driver 2023-02-01 17:23:38 +01:00
xen xen: Allow platform PCI interrupt to be shared 2023-02-13 06:53:20 +01:00