From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: linux-input@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Peter Hutterer <peter.hutterer@who-t.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] Input: try trimming too long modalias strings
Date: Wed, 1 May 2024 12:11:49 -0700 [thread overview]
Message-ID: <ZjKT9QYB1ScvYeIo@google.com> (raw)
In-Reply-To: <CAKf6xpsiLbZN=v2G052kuwPLNxmmbt4uoZAM21Zr+RtH0YD8kA@mail.gmail.com>
On Tue, Apr 30, 2024 at 06:25:13PM -0400, Jason Andryuk wrote:
> On Mon, Apr 29, 2024 at 9:04 PM Jason Andryuk <jandryuk@gmail.com> wrote:
> >
> > On Mon, Apr 29, 2024 at 5:50 PM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > 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>
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >
> > Tested-by: Jason Andryuk <jandryuk@gmail.com>
> >
> > I don't have the gdm setup available to test, but loginctl looks good
> > showing the Xen Virtual Keyboard assigned to a seat:
> > # loginctl seat-status seat0
> > seat0
> > Devices:
> > ├─/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
> > │ input:input0 "Power Button"
> > ├─/sys/devices/LNXSYSTM:00/LNXSLPBN:00/input/input1
> > │ input:input1 "Sleep Button"
> > ├─/sys/devices/platform/i8042/serio0/input/input2
> > │ input:input2 "AT Translated Set 2 keyboard"
> > ├─/sys/devices/platform/i8042/serio1/input/input4
> > │ input:input4 "ImExPS/2 Generic Explorer Mouse"
> > ├─/sys/devices/virtual/input/input5
> > │ input:input5 "Xen Virtual Keyboard"
> > │ └─/sys/devices/virtual/input/input5/event4
> > │ input:event4
> > └─/sys/devices/virtual/input/input6
> > input:input6 "Xen Virtual Pointer"
>
> What do you think about Cc: stable@vger.kernel.org? I'd like to get
> the Xen Keyboard working as widely as possible, so I'd like it
> backported if possible.
I am open to it, but I'd like Benjamin/Hans to take a look at this
as well (I see Peter already gave his Reviewed-by).
Thanks.
--
Dmitry
next prev parent reply other threads:[~2024-05-01 19:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-29 21:50 [PATCH v2] Input: try trimming too long modalias strings Dmitry Torokhov
2024-04-30 1:04 ` Jason Andryuk
2024-04-30 22:25 ` Jason Andryuk
2024-05-01 19:11 ` Dmitry Torokhov [this message]
2024-05-01 3:59 ` Peter Hutterer
-- strict thread matches above, loose matches on Subject: below --
2024-06-13 1:50 Jason Andryuk
2024-06-13 1:52 Jason Andryuk
2024-06-17 12:31 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZjKT9QYB1ScvYeIo@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=hdegoede@redhat.com \
--cc=jandryuk@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.hutterer@who-t.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.