All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonio Quartulli <antonio@meshcoding.com>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCHv4 maint] batman-adv: fix potential kernel paging error for unicast transmissions
Date: Mon, 20 Jan 2014 16:07:53 +0100	[thread overview]
Message-ID: <52DD3BC9.4070603@meshcoding.com> (raw)
In-Reply-To: <1390212404-9726-1-git-send-email-linus.luessing@web.de>

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

On 20/01/14 11:06, Linus Lüssing wrote:
> batadv_send_skb_prepare_unicast(_4addr) might reallocate the skb's
> data. If it does then our ethhdr pointer is not valid anymore in
> batadv_send_skb_unicast(), resulting in a kernel paging error.
> 
> Fixing this by refetching the ethhdr pointer after the potential
> reallocation.
> 
> Introduced by b46c60b9e1ee7a1909c542413a85875a750955d6
> ("batman-adv: improve unicast packet (re)routing")
> 
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>

Acked-by: Antonio Quartulli <antonio@meshcoding.com>

> ---
> Changes v4:
> * "s/Introduced-by:/Introduced by/" to make checkpatch happy
> 
>  send.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/send.c b/send.c
> index b0a3d76..50df184 100644
> --- a/send.c
> +++ b/send.c
> @@ -281,6 +281,10 @@ static int batadv_send_skb_unicast(struct batadv_priv *bat_priv,
>  		goto out;
>  	}
>  
> +	/* skb->data might have been reallocated by
> +	 * batadv_send_skb_prepare_unicast*
> +	 */
> +	ethhdr = eth_hdr(skb);
>  	unicast_packet = (struct batadv_unicast_packet *)skb->data;
>  
>  	/* inform the destination node that we are still missing a correct route
> 


-- 
Antonio Quartulli


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

  reply	other threads:[~2014-01-20 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 10:06 [B.A.T.M.A.N.] [PATCHv4 maint] batman-adv: fix potential kernel paging error for unicast transmissions Linus Lüssing
2014-01-20 15:07 ` Antonio Quartulli [this message]
2014-01-27  7:45   ` 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=52DD3BC9.4070603@meshcoding.com \
    --to=antonio@meshcoding.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.