Find a file
Dmitry Torokhov 0774d19038 Input: try trimming too long modalias strings
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 <jandryuk@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Link: https://lore.kernel.org/r/ZjAWMQCJdrxZkvkB@google.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-05-19 17:58:45 -07:00
arch Fix an FPU invalidation bug on exec(), and fix a performance 2023-08-26 10:57:29 -07:00
block block-6.5-2023-08-19 2023-08-19 17:31:46 +02:00
certs
crypto crypto: fix uninit-value in af_alg_free_resources 2023-08-18 18:30:09 +08:00
Documentation dt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module 2024-04-17 15:27:12 -07:00
drivers Input: try trimming too long modalias strings 2024-05-19 17:58:45 -07:00
fs 18 hotfixes. 13 are cc:stable and the remainder pertain to post-6.4 issues 2023-08-25 11:44:43 -07:00
include Input: make input_class constant 2024-03-10 14:38:04 -07:00
init
io_uring io_uring/parisc: Adjust pgoff in io_uring mmap() for parisc 2023-08-08 12:37:01 -06:00
ipc
kernel A last minute fix for a regression introduced in the v6.5 merge window. The 2023-08-26 10:34:29 -07:00
lib lib/clz_ctz.c: Fix __clzdi2() and __ctzdi2() for 32-bit kernels 2023-08-25 13:22:10 -07:00
LICENSES
mm 18 hotfixes. 13 are cc:stable and the remainder pertain to post-6.4 issues 2023-08-25 11:44:43 -07:00
net Networking fixes for 6.5-rc8, including fixes from wifi, can 2023-08-24 08:23:13 -07:00
rust rust: macros: vtable: fix HAS_* redefinition (gen_const_name) 2023-08-09 21:15:07 +02:00
samples samples: ftrace: Replace bti assembly with hint for older compiler 2023-08-21 22:03:58 -04:00
scripts Kbuild fixes for v6.5 (2nd) 2023-08-13 08:56:24 -07:00
security selinux/stable-6.5 PR 20230821 2023-08-22 10:38:29 -07:00
sound ASoC: Quirk for v6.5 2023-08-25 09:43:49 +02:00
tools 18 hotfixes. 13 are cc:stable and the remainder pertain to post-6.4 issues 2023-08-25 11:44:43 -07:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap mailmap: add entries for Simon Horman 2023-08-16 09:53:10 +01:00
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Input: driver for Adafruit Seesaw Gamepad 2024-01-09 23:45:19 -08:00
Makefile Linux 6.5 2023-08-27 14:49:51 -07:00
README

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.