Article View: linux.kernel.netdev
Article #6724[PATCH net] pppoe: drop discovery frames with no MAC header
From: Qingfang Deng
Date: Fri, 23 Oct 2026 08:00
Date: Fri, 23 Oct 2026 08:00
33 lines
8787 bytes
8787 bytes
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")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
drivers/net/ppp/pppoe.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index ee0e318d6a2a..bdaa8cf8404b 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -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;
--
2.43.0
Technical Details
Message-ID:
<20261023080002.221332-1-qingfang.deng@linux.dev>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350965-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350965-linux-kernel-netdev=dewy.ru From: qingfang.deng@linux.dev (Qingfang Deng) Newsgroups: linux.kernel.netdev Subject: [PATCH net] pppoe: drop discovery frames with no MAC header Date: Fri, 23 Oct 2026 16:00:00 +0800 Organization: Usenet Network Message-ID: <20261023080002.221332-1-qingfang.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="444733"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:WIKciDBNofkGAuETR3VA+dZG8yg= sha256:e3j1AMOIeFfVTuFeQFXMT0nfsFGKo7Nvm1Zv+v+ZXLk= sha1:RpTgZ6EfSNtJAtibpbjY3LBsUwU= sha256:aGCF9rXT8KBCYvJBKr7HwFA54p49TSGSgXaBifQcW9s= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DFF10111435; Fri, 23 Oct 2026 11:05:54 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fObGUAFMY9zr; Fri, 23 Oct 2026 11:05:43 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350965-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5C65E11140C; Fri, 23 Oct 2026 11:05:29 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 7306339D8A; Fri, 23 Oct 2026 08:00:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792742416; b=kkuzVYiimYAERZrCVlqk+l6LuMIyHUa9KvhPUOt7tKiCuKVAykpee2lInPZ92Rx7eg2F Wmc990bvZQ0iGHEdW0IdVgAbIGPqlBIeZmrBOJB9p0AQQDFFRzRJNjYUYDWdy2tdCT95P 17FbJfLyj+gq9kWaRnCV98RZXCQaOiTFm2MGS75rWHdX6fuQ1eyifstXM4TqAQS1x8InV 2NVtoXK2r31ExV5l0itwVn723nkQMK5MktpseQCzX1HaACgOkm5ozm0tbOUva/fm9L/nY yMxkz7bo2gLLXUkJwEkIVpyTXnslsnJZ2f8u+5nmpBcjBbcbvuuCu169aE/1RRDGGOQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792742416; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Subject: Date:Message-ID:X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=ItkFITQqVemDflnB6F4EjAtu7VU2GDqfU5CqgHSl5ag=; b=yy3p0mumdYGPiaERtR4grEN1NgElXg4v3ELSAh9Rhomi6wfXAy7ddiStX1IY6Jo//7OF j6nZSy/soH1Ni3Y2+zVnQDnwzXYQFdpc3x2QiijCjlXo/CKCstVh6qxpKqrWWEl1iyort Dq72xDtngwyvwXt8DASRi/YuMMuoWkwfza8hiV94vkUu01SSBRgew+MxWS3q+cdpTCaSY rTVeZ2MXkTHyn1IBoAfQWr4mG0df/dQ0CpHCgLb9lanPOCKj6DpGFIXZEns23D58as4Ab Cc6e/BrfsPFHRJqeqgp0DzFnb6G/oGCTlNfNVNasaAhXYNVXwEZOje63w4cv7lUblkg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dTXPoxop; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3CB88606A323; Fri, 23 Oct 2026 08:00:16 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dTXPoxop X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.25 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792742415; b=cLXtffup9sUSy2ZJniZ8jBk2xJjDPOhiyRWDYnFYZEFEX6nMwy6k9Xcs4tRSOt2MkF5O jeif26/aonBl8E/CpwKJYZj1abOLIrAPenjpgy3X/5odsuaURTf1WhAY8wLzHbb79hqU1 Ute/mBLbQIE/4d9EQ4SSJ4Q6/aSv+7gZtYv1eztRxhb8IgQH03Zw1Db7U810297obj4A9 L7a2/cTK4QZoW/GHRMESEJLIfNAH9CiPkqLknxZUh0IgGFABZXvqlZtKF3SycdgwmqKgg hBVcd5ZntCkaCbr6t+dW+OwyeIqp91/AShzZVEd5vt3SDjcmJZjcgyC4U5Dl0ZiSNIQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792742415; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=ItkFITQqVemDflnB6F4EjAtu7VU2GDqfU5CqgHSl5ag=; b=hpA71FkMtQBZLnjzV4NYszzc20YHpivZOBpvZwOm1UDnMbvo+94GjtzxYrDlb6J1VR6y OW685YjRIYyHHjg0qIqWgxU04b8PvqpL+fq1g9JiOfqAiy2Z/DasP0oI4dmFCCD9PEMNK QHClbFTj1FS5/dfll2cJGr7jzLGHDAW5H0o/Nc25DZWN1VLRb3XYGWSI1C9cEQJ3D6X3N v/RWIil9skFc6oZBM4uos/GV1V4QxhKG6UFwB+pDLkFEO3w5IHilrkSWTGF20ehHICq0V 0e3HzNo1VhtFLVrBXJgA1W2wBJ5IEZJpcUe6Xz8H7RbJF4pujsr4WfxZEX75fB59KYA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=dTXPoxop; arc=none smtp.remote-ip=91.218.175.25 X-Received: from mta0.migadu.com (out-25.mta0.migadu.com [91.218.175.25]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7ECF606A31F for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 08:00:14 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B7ECF606A31F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=nRUZmgSDvGljOjKJtqokZxEuSspYSr0j3ajei4dg+dU=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1792742412; v=1; x=1793347212; b=dTXPoxopHflo3Rltzuy0ZvhB2RyZkBABrOZEfOmM5+b6FWkYHe0LdBEcIDyxDhasc9kPGD0H N3Manxde9PL7Rt6Ym78cO3aDOQ0vCLbycN82vG186e7aW+BbkQcg9TiDeTmOrb1PgPP91TR5BAW 752tv1Z+cbU/Ed/6gAdxImxw= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 95aa2cc1081f3afa; Fri, 23 Oct 2026 08:00:10 +0000 X-Mizu-Trace-ID: 95aa2cc1081f3afa X-Migadu-Flow: FLOW_OUT X-Mailer: git-send-email 2.43.0 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list