b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: "Linus Lüssing" <linus.luessing@web.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] (no subject)
Date: Fri,  2 Aug 2013 14:44:54 +0200	[thread overview]
Message-ID: <1375447495-31820-1-git-send-email-linus.luessing@web.de> (raw)

Hi,

This second version adds a few more cases I could spot which look like trouble.

Secondly, instead of copying the destination mac on the stack it simply uses
eth_hdr().


Why do we need no skb_reset_mac_header() or skb_set_mac_header()? Because
batadv_skb_head_push() calls skb_headers_offset_update() after the reallocation
(via skb_cow_head()->__skb_cow()->pskb_expand_head()->
skb_headers_offset_update().

I also checked that the ether header in the newly allocated buffer is not going
to end up being fragmented. But looks like pskb_expand_head() actually reserves
enough space for both the old ethernet header plus the newly requested head
space.

So if the mac header was set correctly before, then eth_hdr() will point us
to the right one already.


This patch is maybe not so straight forward, you need to read quite skb
code. At least not as straight forward as the previous version of this patch.
So I leave it up to you to decide whether this is suitable for next or whether
you think there's a potential for unseen pitfalls, therefore making it
suitable for master only :).


This patch fixed the kernel panic I was reproduceably getting just as well. 
(Which was while sending multicast packets through the unicast functions
while having a bridge on top of bat0)


Cheers, Linus


             reply	other threads:[~2013-08-02 12:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 12:44 Linus Lüssing [this message]
2013-08-02 12:44 ` [B.A.T.M.A.N.] [PATCHv2 next] batman-adv: fix potential kernel paging errors for unicast transmissions Linus Lüssing
2013-08-05  8:36   ` Marek Lindner
  -- strict thread matches above, loose matches on Subject: below --
2018-09-28  6:17 [B.A.T.M.A.N.] (no subject) udit kalra
2017-04-25  0:02 Linus Lüssing
2013-10-19 22:21 Antonio Quartulli
2013-10-20  0:15 ` David Miller
     [not found] <pull request for net: batman-adv 2013-05-21>
2013-05-21 19:53 ` Antonio Quartulli
2013-05-21 19:56   ` Antonio Quartulli
2013-05-23  7:08     ` David Miller
2011-05-02 19:19 [B.A.T.M.A.N.] [PATCHv4 1/2] batman-adv: Remove unnecessary hardif_list_lock Sven Eckelmann
2011-05-03  9:51 ` [B.A.T.M.A.N.] (no subject) Linus Lüssing
2011-05-03 12:40   ` Sven Eckelmann
2010-12-07 14:39 [B.A.T.M.A.N.] [PATCH 10/10] batman-adv: Use local tq values determined by NDP on OGMs Linus Lüssing
2010-12-07 20:19 ` [B.A.T.M.A.N.] (no subject) Linus Lüssing
2010-09-30 12:08 Marek Lindner
2010-10-09 11:44 ` Marek Lindner
2010-08-22 20:53 Linus Lüssing
2007-12-11  1:37 giuseppe de marco
2007-12-11  2:03 ` Alexander Morlang
2007-12-11  5:18 ` a.anselmi
2007-12-11 17:23 ` elektra
2007-12-11 18:43 ` Steven Leeman

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=1375447495-31820-1-git-send-email-linus.luessing@web.de \
    --to=linus.luessing@web.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;
as well as URLs for NNTP newsgroup(s).