Skip to contentSkip to conversation

pppoe: drop discovery frames with no MAC header

PATCH Applied Qingfang Deng 3 participants 3 messages Oct 23 – Oct 27

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

PATCH 1/1 pppoe: drop discovery frames with no MAC header

Commit 8540827ebac6 ("pppoe: fix reception of frames with no mac header") drops PPPoE session frames with no MAC header to avoid reading uninitialized memory.

Apply the same to PPPoE discovery frames, as both functions read eth_hdr(skb)->h_source.

Found by LLM static analysis, and reproduced using the same TUN injection as described in the mentioned commit.

Fixes 8540827ebac6 ("pppoe: fix reception of frames with no mac header")
---
 drivers/net/ppp/pppoe.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ppp/pppoe.c +3 -0
index ee0e318d6a2a..bdaa8cf8404b 100644
@@ -460,6 +460,9 @@ static int pppoe_disc_rcv(struct sk_buff *skb, struct net_device *dev,
 	if (skb->pkt_type != PACKET_HOST)
 		goto abort;
 
+	if (skb_mac_header_len(skb) < ETH_HLEN)
+		goto abort;
+
 	if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
 		goto abort;
 
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Qingfang Deng

Commit 8540827ebac6 ("pppoe: fix reception of frames with no mac header") drops PPPoE session frames with no MAC header to avoid reading uninitialized memory.

Quoted 8 lines

Apply the same to PPPoE discovery frames, as both functions read eth_hdr(skb)->h_source.

Found by LLM static analysis, and reproduced using the same TUN injection as described in the mentioned commit.

Fixes 8540827ebac6 ("pppoe: fix reception of frames with no mac header")
#2 lore raw
In reply to Qingfang Deng
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 23 Oct 2026 16:00:00 +0800 you wrote:

Commit 8540827ebac6 ("pppoe: fix reception of frames with no mac header") drops PPPoE session frames with no MAC header to avoid reading uninitialized memory.

Apply the same to PPPoE discovery frames, as both functions read eth_hdr(skb)->h_source.

[...]

Here is the summary with links:
- [net] pppoe: drop discovery frames with no MAC header

    https://git.kernel.org/netdev/net/c/406bf2dc8d6d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html