public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stefan Bader <stefan.bader@canonical•com>
To: Zoltan Kiss <zoltan.kiss@linaro•org>,
	Eric Dumazet <eric.dumazet@gmail•com>
Cc: netdev@vger•kernel.org, "David S. Miller" <davem@davemloft•net>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle•com>,
	Boris Ostrovsky <boris.ostrovsky@oracle•com>,
	David Vrabel <david.vrabel@citrix•com>,
	Jay Vosburgh <jay.vosburgh@canonical•com>,
	linux-kernel@vger•kernel.org, xen-devel@lists•xenproject.org
Subject: Re: [Xen-devel] BUG in xennet_make_frags with paged skb data
Date: Fri, 07 Nov 2014 13:28:33 +0100	[thread overview]
Message-ID: <545CBAF1.4020207@canonical.com> (raw)
In-Reply-To: <545CB92E.9050106@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1357 bytes --]

On 07.11.2014 13:21, Zoltan Kiss wrote:
> 
> 
> On 07/11/14 12:15, Stefan Bader wrote:
>> On 07.11.2014 12:22, Eric Dumazet wrote:
>>> On Fri, 2014-11-07 at 09:25 +0000, Zoltan Kiss wrote:
>>>
>>> Please do not top post.
>>>
>>>> Hi,
>>>>
>>>> AFAIK in this scenario your skb frag is wrong. The page pointer should
>>>> point to the original compound page (not a member of it), and offset
>>>> should be set accordingly.
>>>> For example, if your compound page is 16K (4 page), then the page
>>>> pointer should point to the first page, and if the data starts at the
>>>> 3rd page, then offset should be >8K
>>>
>>> This is not accurate.
>>>
>>> This BUG_ON() is wrong.
>>>
>>> It should instead be :
>>>
>>> BUG_ON(len + offset > PAGE_SIZE<<compound_order(compound_head(page)));
>>
>> would that not have to be
>>
>> BUG_ON((page-compound_head(page)*PAGE_SIZE)+offset+len >
>> PAGE_SIZE<<compound_order(compound_head(page)));
> 
> There should be a parentheses around "page-compound_head(page)".

*sigh* before submitting anything I'll have to make sure I run it past the
compiler at least. I never manager to type the beast without some error.

But you got the drift...

>>
>> since offset is adjusted to start from the tail page in that case.
>>>
>>> splice() code can generate such cases.
>>>
>>>
>>
>>



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-11-07 12:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 21:49 BUG in xennet_make_frags with paged skb data Seth Forshee
2014-11-07  9:25 ` [Xen-devel] " Zoltan Kiss
2014-11-07 11:22   ` Eric Dumazet
2014-11-07 12:15     ` Stefan Bader
2014-11-07 12:21       ` Zoltan Kiss
2014-11-07 12:28         ` Stefan Bader [this message]
2014-11-07 10:44 ` David Vrabel
2014-11-07 11:08   ` Stefan Bader
2014-11-07 14:51     ` [Xen-devel] " Zoltan Kiss
2014-11-10 14:35   ` Seth Forshee
2014-11-10 14:41     ` David Vrabel
2014-11-10 16:39       ` [Xen-devel] " Zoltan Kiss
2014-11-10 16:42         ` David Vrabel
2014-11-10 17:02           ` Eric Dumazet
2014-11-10 17:20           ` Frediano Ziglio

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=545CBAF1.4020207@canonical.com \
    --to=stefan.bader@canonical$(echo .)com \
    --cc=boris.ostrovsky@oracle$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=david.vrabel@citrix$(echo .)com \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=jay.vosburgh@canonical$(echo .)com \
    --cc=konrad.wilk@oracle$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=xen-devel@lists$(echo .)xenproject.org \
    --cc=zoltan.kiss@linaro$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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