b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
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.] bat_events: page allocation failure (batman-adv maint)
Date: Mon, 25 Jan 2010 07:47:47 +0100	[thread overview]
Message-ID: <20100125064747.GS24649@lunn.ch> (raw)
In-Reply-To: <20100124204212.GA4350@Sellars>

Staging: batman-adv: Fix skbuff leak in VIS code.

The vis code takes a copy of the data inside the skbuf if it is interesting 
for us, so we always need to release the skbuf.

Reported-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Index: routing.c
===================================================================
--- routing.c	(revision 1563)
+++ routing.c	(working copy)
@@ -1135,21 +1135,22 @@
 	if (is_my_mac(vis_packet->sender_orig))
 		return NET_RX_DROP;
 
+	/* We take a copy of the data in the packet, so we should
+	   always free the skbuf. */
+	ret = NET_RX_DROP;
+	
 	switch (vis_packet->vis_type) {
 	case VIS_TYPE_SERVER_SYNC:
 		/* TODO: handle fragmented skbs properly */
 		receive_server_sync_packet(vis_packet, skb_headlen(skb));
-		ret = NET_RX_SUCCESS;
 		break;
 
 	case VIS_TYPE_CLIENT_UPDATE:
 		/* TODO: handle fragmented skbs properly */
 		receive_client_update_packet(vis_packet, skb_headlen(skb));
-		ret = NET_RX_SUCCESS;
 		break;
 
 	default:	/* ignore unknown packet */
-		ret = NET_RX_DROP;
 		break;
 	}
 	return ret;

  parent reply	other threads:[~2010-01-25  6:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-23 17:46 [B.A.T.M.A.N.] bat_events: page allocation failure (batman-adv maint) Linus Lüssing
2010-01-23 18:10 ` Andrew Lunn
2010-01-23 23:30   ` Linus Lüssing
2010-01-24 20:42   ` Linus Lüssing
2010-01-24 21:00     ` Andrew Lunn
2010-01-25  6:46       ` Andrew Lunn
2010-01-25  6:47     ` Andrew Lunn [this message]
2010-01-25  8:21       ` Marek Lindner
2010-01-26  1:48       ` Linus Lüssing
2010-01-24  4:24 ` Linus Lüssing
2010-01-26  6:13 ` [B.A.T.M.A.N.] slowpath warning Linus Lüssing
2010-01-26  7:16   ` Marek Lindner
2010-01-27  0:10     ` Linus Lüssing
2010-01-28  0:09       ` Marek Lindner
2010-01-28  6:29         ` Andrew Lunn
2010-01-29  8:25   ` Andrew Lunn
2010-01-29  8:59     ` Marek Lindner
2010-01-30 16:50       ` Andrew Lunn
2010-01-31 19:37         ` Linus Lüssing
2010-01-31 20:56           ` Andrew Lunn
2010-02-11  9:46         ` Andrew Lunn
2010-02-11 10:01           ` Andrew Lunn
2010-02-19 17:19             ` Linus Lüssing
2010-02-20 18:04               ` Andrew Lunn
2010-02-21 13:10                 ` Linus Lüssing
2010-02-28 16:34             ` Simon Wunderlich
2010-03-01  5:59               ` Andrew Lunn
2010-03-01 16:57                 ` Simon Wunderlich
2010-03-02  6:43                   ` Andrew Lunn
2010-03-02 21:13                     ` Simon Wunderlich
2010-03-02 21:26                       ` elektra
2010-03-02 21:44                       ` Linus Lüssing
2010-03-04  0:26                         ` Linus Lüssing
2010-03-04  8:57                           ` Andrew Lunn
2010-03-04  9:19                             ` Marek Lindner
2010-03-04  9:49                               ` Andrew Lunn
2010-03-04 10:00                                 ` 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=20100125064747.GS24649@lunn.ch \
    --to=andrew@lunn.ch \
    --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;
as well as URLs for NNTP newsgroup(s).