Skip to contentSkip to conversation

PPPOE skb leak

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

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PPPOE packet reception does not check the return value of sock_queue_rcv_skb() and therefore can leak packets.

Here is the fix I've installed.

# 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.1486 -> 1.1487
# drivers/net/pppoe.c 1.35 -> 1.36
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/11/24 [email protected] 1.1487
# [PPPOE]: Do not leak SKB if sock_queue_rcv_skb() fails.
# --------------------------------------------
#

drivers/net/pppoe.c +2 -1
diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c
@@ -352,7 +352,8 @@
 		if (!__pppoe_xmit( relay_po->sk, skb))
 			goto abort_put;
 	} else {
-		sock_queue_rcv_skb(sk, skb);
+		if (sock_queue_rcv_skb(sk, skb))
+			goto abort_kfree;
 	}
 
 	return NET_RX_SUCCESS;