public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Receive fragmented packets and merge
Date: Wed, 24 Apr 2013 03:43:06 +0800	[thread overview]
Message-ID: <201304240343.06405.lindner_marek@yahoo.de> (raw)
In-Reply-To: <20130423193004.GA16603@ritirata.org>

On Wednesday, April 24, 2013 03:30:04 Antonio Quartulli wrote:
> On Wed, Apr 24, 2013 at 03:17:26AM +0800, Marek Lindner wrote:
> > On Sunday, April 21, 2013 00:17:33 Martin Hundebøll wrote:
> > > +	/* Make room for the rest of the fragments. */
> > > +	if (pskb_expand_head(skb_out, 0, size - skb->len, GFP_ATOMIC) < 0) {
> > > +		kfree_skb(skb_out);
> > > +		goto free;
> > > +	}
> > 
> > If pskb_expand_head() really fails this function will lead to a crash
> > because skb_out points to undefined memory.
> 
> I'm not sure about this. pskb_expand_head() can only fail in the early
> phase and in that case it seems to return the original skb as it was.

I guess I did not make myself sufficiently clear: If pskb_expand_head() fails 
the skb is free'd with "kfree_skb(skb_out);" followed by a jump to "free" 
where the recently free'd buffer is returned ...


> > Btw, is pskb_expand_head() enough to handle all cases ? Did you try this
> > with a large (4000 bytes or more) packet ?
> 
> I don't personally see any problem with this. But maybe I am overlooking
> something..however, proper testing will make everybody happy :P

Agreed. I wasn't sure there is a problem but wanted to know whether it was 
tested.

Cheers,
Marek

  reply	other threads:[~2013-04-23 19:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-20 16:17 [B.A.T.M.A.N.] [PATCH 0/3] Fragmentation version 2 Martin Hundebøll
2013-04-20 16:17 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Remove old fragmentation code Martin Hundebøll
2013-04-23 17:32   ` Marek Lindner
2013-04-20 16:17 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Receive fragmented packets and merge Martin Hundebøll
2013-04-23 19:17   ` Marek Lindner
2013-04-23 19:30     ` Antonio Quartulli
2013-04-23 19:43       ` Marek Lindner [this message]
2013-04-23 19:47         ` Antonio Quartulli
2013-04-20 16:17 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Fragment and send skbs larger than mtu Martin Hundebøll
2013-04-23 19:35   ` Marek Lindner

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=201304240343.06405.lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /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