android_kernel_motorola_sm6375/drivers/input
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Dmitry Torokhov 08637180f7 Input: try trimming too long modalias strings
commit 0774d19038c496f0c3602fb505c43e1b2d8eed85 upstream.

If an input device declares too many capability bits then modalias
string for such device may become too long and not fit into uevent
buffer, resulting in failure of sending said uevent. This, in turn,
may prevent userspace from recognizing existence of such devices.

This is typically not a concern for real hardware devices as they have
limited number of keys, but happen with synthetic devices such as
ones created by xen-kbdfront driver, which creates devices as being
capable of delivering all possible keys, since it doesn't know what
keys the backend may produce.

To deal with such devices input core will attempt to trim key data,
in the hope that the rest of modalias string will fit in the given
buffer. When trimming key data it will indicate that it is not
complete by placing "+," sign, resulting in conversions like this:

old: k71,72,73,74,78,7A,7B,7C,7D,8E,9E,A4,AD,E0,E1,E4,F8,174,
new: k71,72,73,74,78,7A,7B,7C,+,

This should allow existing udev rules continue to work with existing
devices, and will also allow writing more complex rules that would
recognize trimmed modalias and check input device characteristics by
other means (for example by parsing KEY= data in uevent or parsing
input device sysfs attributes).

Note that the driver core may try adding more uevent environment
variables once input core is done adding its own, so when forming
modalias we can not use the entire available buffer, so we reduce
it by somewhat an arbitrary amount (96 bytes).

Reported-by: Jason Andryuk <[email protected]>
Reviewed-by: Peter Hutterer <[email protected]>
Tested-by: Jason Andryuk <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: [email protected]
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Jason Andryuk <[email protected]>
2024-07-05 09:08:16 +02:00
..
gameport
joystick Input: xpad - add Razer Wolverine V2 support 2024-01-25 14:34:21 -08:00
keyboard Input: gpio_keys_polled - suppress deferred probe error for gpio 2024-03-26 18:22:13 -04:00
misc Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation 2024-06-16 13:28:43 +02:00
mouse Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport 2023-11-08 11:23:40 +01:00
rmi4 Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails 2024-04-13 12:51:38 +02:00
serio Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU 2024-03-15 10:48:18 -04:00
tablet
touchscreen Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe 2023-05-17 11:35:52 +02:00
apm-power.c
evbug.c
evdev.c
ff-core.c
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c
input-polldev.c
input-poller.c
input-poller.h
input.c Input: try trimming too long modalias strings 2024-07-05 09:08:16 +02:00
joydev.c
Kconfig
Makefile
matrix-keymap.c
mousedev.c
sparse-keymap.c