linux/drivers
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
..
accel Fix mismerge due to devnode now taking a 'const *' device 2022-12-16 13:04:15 -06:00
accessibility tty: fix possible null-ptr-defer in spk_ttyio_release 2023-01-19 16:24:04 +01:00
acpi arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
amba ARM updates for 6.2 2022-12-13 15:22:14 -08:00
android fs: port ->rename() to pass mnt_idmap 2023-01-19 09:24:26 +01:00
ata ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
atm treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
auxdisplay
base regmap: Updates for v6.3 2023-02-22 10:42:55 -08:00
bcma
block for-6.3/block-2023-02-16 2023-02-20 14:27:21 -08:00
bluetooth Bluetooth: btintel: Set Per Platform Antenna Gain(PPAG) 2023-02-09 14:20:04 -08:00
bus bus: sunxi-rsb: Fix error handling in sunxi_rsb_init() 2023-01-08 21:35:01 +01:00
cdrom
char This update includes the following changes: 2023-02-21 18:10:50 -08:00
clk Scheduler updates in this cycle are: 2023-02-20 17:41:08 -08:00
clocksource Updates for timekeeping, timers and clockevent/source drivers: 2023-02-21 09:45:13 -08:00
comedi comedi: adv_pci1760: Fix PWM instruction handling 2023-01-19 17:24:47 +01:00
connector
counter
cpufreq ACPI updates for 6.3-rc1 2023-02-21 12:23:24 -08:00
cpuidle Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
crypto This update includes the following changes: 2023-02-21 18:10:50 -08:00
cxl cxl/region: Fix passthrough-decoder detection 2023-02-07 11:04:30 -08:00
dax RCU pull request for v6.3 2023-02-21 10:45:51 -08:00
dca
devfreq
dio
dma ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
dma-buf dma-buf: actually set signaling bit for private stub fences 2023-01-27 14:16:18 +01:00
edac - Add a driver for the RAS functionality on Xilinx's on chip memory 2023-02-21 08:10:03 -08:00
eisa
extcon Char/Misc driver changes for 6.2-rc1 2022-12-16 03:49:24 -08:00
firewire firewire: cdev: use single object to dispatch event for request to IEC 61883-1 FCP region 2023-01-23 09:17:46 +01:00
firmware arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
fpga fpga: m10bmc-sec: Fix probe rollback 2022-12-30 10:49:52 +08:00
fsi
gnss
gpio Core changes: 2023-02-22 11:05:56 -08:00
gpu hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
greybus
hid HID: core: Provide new max_buffer_size attribute to over-ride the default 2023-02-23 11:51:56 +01:00
hsi
hte
hv hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
hwmon hwmon: remove s3c driver 2023-01-16 09:26:05 +01:00
hwspinlock
hwtracing drivers/hwtracing/stm: Remove "select SRCU" 2023-02-02 16:26:05 -08:00
i2c Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
i3c i3c: export SETDASA method 2022-12-11 21:25:58 +01:00
idle Power management updates for 6.3-rc1 2023-02-21 12:13:58 -08:00
iio for-linus-2023022201 2023-02-22 11:24:42 -08:00
infiniband Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net 2023-02-17 11:06:39 +00:00
input hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
interconnect SoC: DT changes for 6.3 2023-02-20 15:49:56 -08:00
iommu iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe() 2023-01-13 13:46:32 +01:00
ipack
irqchip arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
isdn treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
leds platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
macintosh
mailbox - qcom: enable sc8280xp, sm8550 and sm4250 support 2022-12-21 09:31:18 -08:00
mcb
md This update includes the following changes: 2023-02-21 18:10:50 -08:00
media platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
memory memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe() 2022-12-27 09:54:32 +01:00
memstick memstick/mspro_block: Convert to use sysfs_emit()/sysfs_emit_at() APIs 2022-12-09 10:29:58 +01:00
message
mfd sound updates for 6.3-rc1 2023-02-22 10:29:05 -08:00
misc hardening updates for v6.3-rc1 2023-02-21 11:07:23 -08:00
mmc ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
most
mtd ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
mux
net Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
nfc nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame() 2023-01-09 07:34:13 +00:00
ntb
nubus
nvdimm nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE 2023-01-28 15:32:36 -08:00
nvme Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
nvmem nvmem: qcom-spmi-sdam: fix module autoloading 2023-01-28 14:39:31 +01:00
of 12 hotfixes, mostly against mm/. Five of these fixes are cc:stable. 2023-02-13 14:09:20 -08:00
opp OPP: fix error checking in opp_migrate_dentry() 2023-02-08 10:40:59 +05:30
parisc parisc: pdc_stable: use strscpy() to instead of strncpy() 2023-01-09 09:51:56 +01:00
parport parport: remove ax88796 driver 2023-01-16 09:26:06 +01:00
pci hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
pcmcia pcmcia: remove unused pxa/sa1100 drivers 2023-02-01 17:23:38 +01:00
peci
perf arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
phy phy: phy-can-transceiver: Skip warning if no "max-bitrate" 2023-01-18 22:58:05 +05:30
pinctrl Core changes: 2023-02-22 11:05:56 -08:00
platform for-linus-2023022201 2023-02-22 11:24:42 -08:00
pnp
power platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
powercap Thermal control updates for 6.3-rc1 2023-02-21 12:32:05 -08:00
pps
ps3
ptp ptp_qoriq: fix latency in ptp_qoriq_adjtime() operation 2023-01-20 18:20:38 -08:00
pwm pwm: Changes for v6.2-rc1 2022-12-21 09:41:28 -08:00
rapidio rapidio: devices: fix missing put_device in mport_cdev_open 2022-12-11 19:30:20 -08:00
ras
regulator regulator: Updates for v6.3 2023-02-22 10:49:32 -08:00
remoteproc remoteproc: core: Do pm_relax when in RPROC_OFFLINE state 2022-12-07 11:20:55 -07:00
reset reset: uniphier-glue: Fix possible null-ptr-deref 2023-01-03 11:30:46 +01:00
rpmsg
rtc ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
s390 Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
sbus
scsi Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
sh
siox
slimbus
soc Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
soundwire soundwire: stream: Add specific prep/deprep commands to port_prep callback 2023-01-31 12:10:45 +00:00
spi spi: Updates for v6.3 2023-02-22 10:53:37 -08:00
spmi
ssb
staging for-linus-2023022201 2023-02-22 11:24:42 -08:00
target Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
tc
tee tee: Remove call to get_kernel_pages() 2023-02-13 14:16:40 +01:00
thermal thermal/drivers/st: Remove syscfg based driver 2023-02-15 17:30:04 +01:00
thunderbolt thunderbolt: Disable XDomain lane 1 only in software connection manager 2023-01-09 10:44:43 +02:00
tty ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
ufs scsi: ufs: core: Fix devfreq deadlocks 2023-01-18 19:08:37 -05:00
uio Drivers: hv: Make remove callback of hyperv driver void returned 2023-01-17 13:41:27 +00:00
usb ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
vdpa Updates for this cycle were: 2023-02-20 17:18:23 -08:00
vfio vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp() 2023-01-10 10:44:37 -07:00
vhost Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
video hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
virt Char/Misc driver changes for 6.2-rc1 2022-12-16 03:49:24 -08:00
virtio virtio: Implementing attribute show with sysfs_emit 2022-12-28 05:28:11 -05:00
vlynq
w1 ARM: unused boardfile removal for 6.3 2023-02-20 15:28:57 -08:00
watchdog s390 updates for 6.3 merge window 2023-02-21 15:09:17 -08:00
xen Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
zorro
Kconfig
Makefile