]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.7.7/batman-adv-fix-elp-packet-data-reservation.patch
fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.7.7 / batman-adv-fix-elp-packet-data-reservation.patch
1 From 1e5d343b8f23770e8ac5d31f5c439826bdb35148 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Linus=20L=C3=BCssing?= <linus.luessing@c0d3.blue>
3 Date: Tue, 23 Aug 2016 03:13:03 +0200
4 Subject: batman-adv: fix elp packet data reservation
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Linus Lüssing <linus.luessing@c0d3.blue>
10
11 commit 1e5d343b8f23770e8ac5d31f5c439826bdb35148 upstream.
12
13 The skb_reserve() call only reserved headroom for the mac header, but
14 not the elp packet header itself.
15
16 Fixing this by using skb_put()'ing towards the skb tail instead of
17 skb_push()'ing towards the skb head.
18
19 Fixes: d6f94d91f766 ("batman-adv: ELP - adding basic infrastructure")
20 Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
21 Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
22 Signed-off-by: Sven Eckelmann <sven@narfation.org>
23 Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25
26 ---
27 net/batman-adv/bat_v_elp.c | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30 --- a/net/batman-adv/bat_v_elp.c
31 +++ b/net/batman-adv/bat_v_elp.c
32 @@ -334,7 +334,7 @@ int batadv_v_elp_iface_enable(struct bat
33 goto out;
34
35 skb_reserve(hard_iface->bat_v.elp_skb, ETH_HLEN + NET_IP_ALIGN);
36 - elp_buff = skb_push(hard_iface->bat_v.elp_skb, BATADV_ELP_HLEN);
37 + elp_buff = skb_put(hard_iface->bat_v.elp_skb, BATADV_ELP_HLEN);
38 elp_packet = (struct batadv_elp_packet *)elp_buff;
39 memset(elp_packet, 0, BATADV_ELP_HLEN);
40