Re: [PATCH (resend)] Input: MT - limit max slots

From: Linus Torvalds
Date: Mon Jul 29 2024 - 16:15:25 EST


On Mon, 29 Jul 2024 at 13:00, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
>
> Hmm, maybe the checks should go into drivers/input/misc/uinput.c which
> is the only place that allows userspace to create input device instances
> and drive them rather than into input core logic because all other
> devices are backed by real hardware.

Ack, that sounds like a good idea, particularly if there is some
single location that could validate the input.

uinput_validate_absinfo(), perhaps?

We do end up trying to protect against some forms of bad hardware too
when possible, but realistically _that_ kind of protection should be
more along the lines of "don't cause security issues".

Linus