batman-adv: 2014.0.0 updated stability fixes
[feed/routing.git] / batman-adv / patches / 0002-batman-adv-fix-potential-kernel-paging-error-for-uni.patch
1 From 41b38727749a94c1a65cf0f4be9bfe1cbaf0adeb Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@web.de>
3 Date: Mon, 20 Jan 2014 11:06:44 +0100
4 Subject: [PATCH 2/5] batman-adv: fix potential kernel paging error for unicast
5 transmissions
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 batadv_send_skb_prepare_unicast(_4addr) might reallocate the skb's
11 data. If it does then our ethhdr pointer is not valid anymore in
12 batadv_send_skb_unicast(), resulting in a kernel paging error.
13
14 Fixing this by refetching the ethhdr pointer after the potential
15 reallocation.
16
17 Introduced by b46c60b9e1ee7a1909c542413a85875a750955d6
18 ("batman-adv: improve unicast packet (re)routing")
19
20 Signed-off-by: Linus L├╝ssing <linus.luessing@web.de>
21 Acked-by: Antonio Quartulli <antonio@meshcoding.com>
22 Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
23 ---
24 send.c | 4 ++++
25 1 file changed, 4 insertions(+)
26
27 diff --git a/send.c b/send.c
28 index b0a3d76..2035bd9 100644
29 --- a/send.c
30 +++ b/send.c
31 @@ -281,6 +281,10 @@ static int batadv_send_skb_unicast(struct batadv_priv *bat_priv,
32 goto out;
33 }
34
35 + /* skb->data might have been reallocated by
36 + * batadv_send_skb_prepare_unicast{,_4addr}()
37 + */
38 + ethhdr = eth_hdr(skb);
39 unicast_packet = (struct batadv_unicast_packet *)skb->data;
40
41 /* inform the destination node that we are still missing a correct route
42 --
43 1.8.5.3
44