b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: check return type of unicast packet preparations
@ 2013-07-27  1:24 Linus Lüssing
  2013-07-27  1:24 ` [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: fix potential kernel paging error for unicast transmissions Linus Lüssing
  2013-07-28 20:14 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: check return type of unicast packet preparations Antonio Quartulli
  0 siblings, 2 replies; 8+ messages in thread
From: Linus Lüssing @ 2013-07-27  1:24 UTC (permalink / raw)
  To: b.a.t.m.a.n

batadv_send_skb_prepare_unicast(_4addr) might reallocate the skb's data.
And if it tries to do so then this can potentially fail.

We shouldn't continue working on this skb in such a case.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
 unicast.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/unicast.c b/unicast.c
index dc8b5d4..4c5a1aa 100644
--- a/unicast.c
+++ b/unicast.c
@@ -428,11 +428,13 @@ find_router:
 
 	switch (packet_type) {
 	case BATADV_UNICAST:
-		batadv_unicast_prepare_skb(skb, orig_node);
+		if (!batadv_unicast_prepare_skb(skb, orig_node))
+			goto out;
 		break;
 	case BATADV_UNICAST_4ADDR:
-		batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
-						 packet_subtype);
+		if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node,
+						      packet_subtype))
+			goto out;
 		break;
 	default:
 		/* this function supports UNICAST and UNICAST_4ADDR only. It
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-08-02  8:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-27  1:24 [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: check return type of unicast packet preparations Linus Lüssing
2013-07-27  1:24 ` [B.A.T.M.A.N.] [PATCH next 2/2] batman-adv: fix potential kernel paging error for unicast transmissions Linus Lüssing
2013-07-28 20:17   ` Antonio Quartulli
2013-08-02  4:05     ` Marek Lindner
2013-08-02  7:18       ` Antonio Quartulli
2013-08-02  8:04         ` Linus Lüssing
2013-07-28 20:14 ` [B.A.T.M.A.N.] [PATCH next 1/2] batman-adv: check return type of unicast packet preparations Antonio Quartulli
2013-08-02  4:02   ` Marek Lindner

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).