All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: netdev@oss.sgi.com
Subject: ECONET skb leak fix
Date: Mon, 24 Nov 2003 20:04:47 -0800	[thread overview]
Message-ID: <20031124200447.7696f2c5.davem@redhat.com> (raw)


Econet had one spot where it could leak SKBs due to a missing
return value check.

Nobody really maintains this thing anymore so I did not CC: any
maintainer :)

Also return NET_RX_DROP as appropriate.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1487  -> 1.1488 
#	net/econet/af_econet.c	1.27    -> 1.28   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24	davem@nuts.ninka.net	1.1488
# [ECONET]: Do not leak SKBs if ec_queue_packet() fails.
# 
# Also, make sure NET_RX_DROP is returned if we did not accept the
# packet.
# --------------------------------------------
#
diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c
--- a/net/econet/af_econet.c	Mon Nov 24 20:01:24 2003
+++ b/net/econet/af_econet.c	Mon Nov 24 20:01:24 2003
@@ -1041,12 +1041,15 @@
 	if (!sk)
 		goto drop;
 
-	return ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb, 
-			       hdr->port);
+	if (ec_queue_packet(sk, skb, edev->net, hdr->src_stn, hdr->cb,
+			    hdr->port))
+		goto drop;
+
+	return 0;
 
 drop:
 	kfree_skb(skb);
-	return 0;
+	return NET_RX_DROP;
 }
 
 static struct packet_type econet_packet_type = {

                 reply	other threads:[~2003-11-25  4:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20031124200447.7696f2c5.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=netdev@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.