* ECONET skb leak fix
@ 2003-11-25 4:04 David S. Miller
0 siblings, 0 replies; only message in thread
From: David S. Miller @ 2003-11-25 4:04 UTC (permalink / raw)
To: netdev
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 = {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-11-25 4:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-25 4:04 ECONET skb leak fix David S. Miller
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).