Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Paolo Abeni <pabeni@redhat.com>, Oliver Neukum <oneukum@suse.com>,
	dmitry.bezrukov@aquantia.com, marcinguy@gmail.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	linux-usb@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCHv2] USB: gl620a: check for rx buffer overflow
Date: Tue, 5 Dec 2023 11:21:54 +0100	[thread overview]
Message-ID: <b66c6ee2-a836-4a83-bc0e-f34cac84a0f1@suse.com> (raw)
In-Reply-To: <73ef03a1607f221c7939cb0646c17c5435dcecd1.camel@redhat.com>



On 05.12.23 09:04, Paolo Abeni wrote:

Hi,

> I think the above is not strict enough: at this point skb->data points
> to the gl_packet header. The first 4 bytes in skb are gl_packet-
>> packet_length. To ensure an overflow is avoided you should check for:
> 
> 		if (size + 4 > skb->len)
> 
> likely with a describing comment.

it seems to me that at the time of the check skb->len has already
been adjusted by the skb_pull() before, respectively at the end, of
the loop.

	Regards
		Oliver


      reply	other threads:[~2023-12-05 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  9:52 [PATCHv2] USB: gl620a: check for rx buffer overflow Oliver Neukum
2023-11-22  9:55 ` Sergey Shtylyov
2023-11-22 10:04   ` Oliver Neukum
2023-11-22 10:07     ` Sergei Shtylyov
2023-11-22 10:20       ` Oliver Neukum
2023-11-24 11:53         ` Simon Horman
2023-11-30  9:38           ` Oliver Neukum
2023-11-30 16:42             ` Simon Horman
2023-12-05  8:04 ` Paolo Abeni
2023-12-05 10:21   ` Oliver Neukum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b66c6ee2-a836-4a83-bc0e-f34cac84a0f1@suse.com \
    --to=oneukum@suse.com \
    --cc=davem@davemloft.net \
    --cc=dmitry.bezrukov@aquantia.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcinguy@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox