public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Pravin B Shelar <pshelar@ovn.org>,
	Florian Westphal <fw@strlen.de>,
	"martin.varghese@nokia.com" <martin.varghese@nokia.com>,
	Willem de Bruijn <willemb@google.com>,
	Davide Caratti <dcaratti@redhat.com>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	Paolo Abeni <pabeni@redhat.com>,
	"shmulik@metanetworks.com" <shmulik@metanetworks.com>,
	"kyk.segfault@gmail.com" <kyk.segfault@gmail.com>,
	netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] net: Fix potential out of bound write in skb_try_coalesce()
Date: Thu, 6 Aug 2020 11:56:33 +0000	[thread overview]
Message-ID: <a1516b0e527246ed8e40ede17e69decd@huawei.com> (raw)

Eric Dumazet <edumazet@google.com> wrote:
>On Tue, Aug 4, 2020 at 4:46 AM linmiaohe <linmiaohe@huawei.com> wrote:
>>
>> From: Miaohe Lin <linmiaohe@huawei.com>
>>
>> The head_frag of skb would occupy one extra skb_frag_t. Take it into 
>> account or out of bound write to skb frags may happen.
>>
>
>Please share a stack trace if this was a real bug spotted in the wild.
>
>I do not believe this patch is correct.
>
>if (A + B >= MAX)   is equivalent to  if (A + B + 1 > MAX)
>
>Note how the other condition (when there is no bytes in skb header) is coded :
>
>if (A + B > MAX) return false;
>
>In anycase, please always provide a Fixes: tag for any bug fix.
>
>Thanks.

Many thanks for your patient explaination. I compared (A + B >= MAX) with (A + B + 1 > MAX) in skb_gro_receive(),
but I missed the '='. It's my oversight, I'am really sorry about it.

Thanks again.


             reply	other threads:[~2020-08-06 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 11:56 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-08-04 11:48 [PATCH] net: Fix potential out of bound write in skb_try_coalesce() linmiaohe
2020-08-04 14:34 ` Eric Dumazet

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=a1516b0e527246ed8e40ede17e69decd@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kuba@kernel.org \
    --cc=kyk.segfault@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.varghese@nokia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pshelar@ovn.org \
    --cc=shmulik@metanetworks.com \
    --cc=steffen.klassert@secunet.com \
    --cc=willemb@google.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