[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <6432a849-512d-4abb-b15a-c2f1b7dd6533@app.fastmail.com>
Date: Fri, 11 Jul 2025 12:01:45 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Benjamin Tissoires" <bentiss@...nel.org>,
"Arnd Bergmann" <arnd@...nel.org>
Cc: "Jiri Kosina" <jikos@...nel.org>,
"Peter Hutterer" <peter.hutterer@...-t.net>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: tighten ioctl command parsing
On Fri, Jul 11, 2025, at 11:40, Benjamin Tissoires wrote:
>
> On Jul 11 2025, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@...db.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
Powered by blists - more mailing lists