[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ybenmz2fmjxjpo3zhnrh2ptquikxrtb63664qbhhfv5d4ezx5n@c3p2tbosx2tz>
Date: Mon, 28 Apr 2025 16:30:13 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Pali Rohár <pali@...nel.org>
Subject: Re: [PATCH v1 1/1] Input: ALPS - bail out when device path can't fit
buffer
Hi Andy,
On Tue, Apr 22, 2025 at 09:56:45PM +0300, Andy Shevchenko wrote:
> @@ -3094,6 +3101,16 @@ int alps_init(struct psmouse *psmouse)
>
> if (priv->flags & ALPS_DUALPOINT) {
> struct input_dev *dev2;
> + int n;
> +
> + n = snprintf(priv->phys2, sizeof(priv->phys2), "%s/input1",
> + psmouse->ps2dev.serio->phys);
> + if (n >= sizeof(priv->phys2)) {
> + psmouse_err(psmouse,
> + "failed to prepare path to the trackstick device\n");
> + error = -E2BIG;
> + goto init_fail;
So you just broke touchpad of some poor guy who had it working just fine
for many years. For maximum impact you should add BUG() or panic()
here.
In all seriousness, it is OK to have truncated phys, rarely anyone looks
at it and if we get a report of it being truncated then we can consider
addressing the size (or we can decide to live with it truncated).
Thanks.
--
Dmitry
Powered by blists - more mailing lists