Skip to contentSkip to conversation

ECONET skb leak fix

DISCUSSION David S. Miller 1 participant 1 message Nov 25, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore 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 [email protected] 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 = {