public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Remove hdr_size skb size check in batadv_interface_rx
Date: Sun, 28 Feb 2016 11:38:52 +0100	[thread overview]
Message-ID: <1456655932-22746-3-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <3805562.RtX9XxSZnx@sven-edge>

The callers of batadv_interface_rx have to make sure that enough data can
be pulled from the skb when they read the batman-adv header. The only two
functions using it are either calling pskb_may_pull with hdr_size directly
(batadv_recv_bcast_packet) or indirectly via batadv_check_unicast_packet
(batadv_recv_unicast_packet).

Reported-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 net/batman-adv/soft-interface.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index bdda984..f24dc59 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -413,10 +413,6 @@ void batadv_interface_rx(struct net_device *soft_iface,
 	batadv_bcast_packet = (struct batadv_bcast_packet *)skb->data;
 	is_bcast = (batadv_bcast_packet->packet_type == BATADV_BCAST);
 
-	/* check if enough space is available for pulling, and pull */
-	if (!pskb_may_pull(skb, hdr_size))
-		goto dropped;
-
 	skb_pull_rcsum(skb, hdr_size);
 	skb_reset_mac_header(skb);
 
-- 
2.7.0


  parent reply	other threads:[~2016-02-28 10:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28 10:37 [B.A.T.M.A.N.] [PATCH 0/3] batadv_interface_rx pskb_may_pull cleanup Sven Eckelmann
2016-02-28 10:38 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Add kernel-doc for batadv_interface_rx Sven Eckelmann
2016-03-20 10:00   ` Marek Lindner
2016-02-28 10:38 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Remove unused parameter recv_if of batadv_interface_rx Sven Eckelmann
2016-03-20 10:01   ` Marek Lindner
2016-02-28 10:38 ` Sven Eckelmann [this message]
2016-03-20 10:01   ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Remove hdr_size skb size check in batadv_interface_rx 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=1456655932-22746-3-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --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