[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ekkelgdcm3ovrix3ktmzhlmc2bgchui4g7ogunut5k3dafhwri@y7fyt3uycxgr>
Date: Fri, 17 Oct 2025 18:08:58 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: pip-izony <eeodqql09@...il.com>
Cc: Kyungtae Kim <Kyungtae.Kim@...tmouth.edu>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] Input: pegasus-notetaker - fix out-of-bounds access
vulnerability in pegasus_parse_packet() function of the pegasus driver
Hi,
On Tue, Oct 07, 2025 at 05:41:32PM -0400, pip-izony wrote:
> From: Seungjin Bae <eeodqql09@...il.com>
>
> In the pegasus_notetaker driver, the pegasus_probe() function allocates
> the URB transfer buffer using the wMaxPacketSize value from
> the endpoint descriptor. An attacker can use a malicious USB descriptor
> to force the allocation of a very small buffer.
>
> Subsequently, if the device sends an interrupt packet with a specific
> pattern (e.g., where the first byte is 0x80 or 0x42),
> the pegasus_parse_packet() function parses the packet without checking
> the allocated buffer size. This leads to an out-of-bounds memory access,
> which could result in a system panic.
>
> Fixes: 948bf18 ("Input: remove third argument of usb_maxpacket()")
> Signed-off-by: Seungjin Bae <eeodqql09@...il.com>
> ---
> drivers/input/tablet/pegasus_notetaker.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
> index 8d6b71d59793..6c4199712a4e 100644
> --- a/drivers/input/tablet/pegasus_notetaker.c
> +++ b/drivers/input/tablet/pegasus_notetaker.c
> @@ -311,6 +311,11 @@ static int pegasus_probe(struct usb_interface *intf,
> }
>
> pegasus->data_len = usb_maxpacket(dev, pipe);
> + if (pegasus->data_len < 5) {
The packet size is actually 6 (status + color + 2-byte X coordinate +
2-byte Y coordinate) so there's still off-by-one error.
I fixed it up and applied.
Thanks.
--
Dmitry
Powered by blists - more mailing lists