Re: [PATCH] HID: core: Reject report fields with a size or count of 0

From: Alan Stern
Date: Mon Jul 21 2025 - 09:56:56 EST


On Mon, Jul 21, 2025 at 03:05:58PM +0200, Benjamin Tissoires wrote:
> > So then would it be better to accept these report fields (perhaps with a
> > warning) and instead, harden the core HID code so that it doesn't choke
> > when it runs across one of them?
> >
>
> Yeah, that seems like the best plan forward.
>
> [sorry on reduced setup for the next 3 weeks, so I can't really debug
> the entire thing now.]
>
> Though, we should probably not annoy users unless we are trying to do
> something that won't be needed. I doubt that Saitek gamepad will ever
> call the faulty functions, so why putting an error in the logs when it's
> working fine?

All right.

Probably the best way to do this is simply to revert the commit that's
already applied and then merge a new patch to harden the core. Would
you like me to post the reversion patch or do you prefer to do it
yourself?

Alan Stern