Message ID | 20231121134315.18721-1-oneukum@suse.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | USB: gl620a: check for rx buffer overflow | expand |
On Tue, 21 Nov 2023 14:43:15 +0100 Oliver Neukum wrote:
> Signed-off-ny: Oliver Neukum <oneukum@suse.com>
s/-ny/-by/ ?
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c index 46af78caf457..d33ae15abdc1 100644 --- a/drivers/net/usb/gl620a.c +++ b/drivers/net/usb/gl620a.c @@ -104,6 +104,10 @@ static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb) return 0; } + /* we also need to check for overflowing the buffer */ + if (size > skb->len) + return 0; + // allocate the skb for the individual packet gl_skb = alloc_skb(size, GFP_ATOMIC); if (gl_skb) {