From: "Arnd Bergmann" <arnd@arndb.de>
To: "Benjamin Tissoires" <bentiss@kernel.org>,
"Arnd Bergmann" <arnd@kernel.org>
Cc: "Jiri Kosina" <jikos@kernel.org>,
"Peter Hutterer" <peter.hutterer@who-t.net>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] HID: tighten ioctl command parsing
Date: Fri, 11 Jul 2025 12:01:45 +0200 [thread overview]
Message-ID: <6432a849-512d-4abb-b15a-c2f1b7dd6533@app.fastmail.com> (raw)
In-Reply-To: <cznzhmuizk6r3tv7ze6lqp3qoyfnu6ktmbwxbjpsf5phthsjoj@x46mthdr66l7>
On Fri, Jul 11, 2025, at 11:40, Benjamin Tissoires wrote:
>
> On Jul 11 2025, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> The handling for variable-length ioctl commands in hidraw_ioctl() is
>> rather complex and the check for the data direction is incomplete.
>>
>> Simplify this code using a switch() statement with the size masked
>> out, to ensure the rest of the command is correctly matched.
>
> How much "urgent" you believe this patch is. I would say 6.17 material,
> but I'm not sure if your analysis regarding "the check for the data
> direction is incomplete." would justify a 6.16 late fix.
I'm not aware of anything being actively broken without my patch,
the driver just accepts extra commands that it should reject instead.
My feeling is that we still want the change backported to stable
kernels as it does address incorrect behavior, and based on that
it should be in a fixes branch for the current release rather than
wait for the merge window.
On the other hand, it needs to be properly tested to ensure
I'm not breaking things.
> Also, lately I added a new tools/testing/selftests/hid/hidraw.c to test
> the latest HIDIOCREVOKE addition. I wonder if we should not add a couple
> of checks there to ensure we get the different kind of other ioctls
> tested before and after this patch.
Yes, makes sense, e.g. testing HIDIOCGFEATURE with incorrect _IOC_DIR
bits would be a useful addition.
Arnd
next prev parent reply other threads:[~2025-07-11 10:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 7:28 [PATCH] HID: tighten ioctl command parsing Arnd Bergmann
2025-07-11 9:40 ` Benjamin Tissoires
2025-07-11 10:01 ` Arnd Bergmann [this message]
2025-08-21 8:16 ` Benjamin Tissoires
2025-08-21 6:56 ` Benjamin Tissoires
2025-08-22 21:08 ` Arnd Bergmann
2025-08-26 10:13 ` Benjamin Tissoires
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=6432a849-512d-4abb-b15a-c2f1b7dd6533@app.fastmail.com \
--to=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox