netdev
[Top] [All Lists]

ECONET skb leak fix

To: netdev@xxxxxxxxxxx
Subject: ECONET skb leak fix
From: "David S. Miller" <davem@xxxxxxxxxx>
Date: Mon, 24 Nov 2003 20:04:47 -0800
Sender: netdev-bounce@xxxxxxxxxxx
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@xxxxxxxxxxxxxx    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 = {

<Prev in Thread] Current Thread [Next in Thread>
  • ECONET skb leak fix, David S. Miller <=