🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5838

[PATCH net] ppp: linearize bridged packets when required

#5838
From: Qingfang Deng
Date: Wed, 21 Oct 2026 02:36
40 lines
9494 bytes
PPP channel bridging is commonly used for PPPoE relaying or forwarding
from PPPoE to PPPoL2TP. Both destination channel types handle non-linear
packets, but other channels, such as PPP Async, require linear packets.

Ethernet drivers can pass non-linear packets to PPPoE. If one is bridged
to PPP Async, ppp_async_encode() accesses the entire packet through
skb->data, assuming that it is linear. This can read beyond the linear
buffer and transmit unrelated memory over the serial interface.

The normal PPP transmit path in ppp_push() linearizes packets before
passing them to channels without direct_xmit. Apply the same rule in
ppp_channel_bridge_input(), and drop the packet if linearization fails.

Fixes: 4cf476ced45d ("ppp: add PPPIOCBRIDGECHAN and PPPIOCUNBRIDGECHAN ioctls")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260908072135.877364-1-qingfang.deng@linux.dev
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
 drivers/net/ppp/ppp_generic.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 1a610a18893b..a84618e24d61 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2299,6 +2299,11 @@ static bool ppp_channel_bridge_input(struct channel *pch, struct sk_buff *skb)
 		goto outl;
 	}
 
+	if (!pchb->chan->direct_xmit && skb_linearize(skb)) {
+		kfree_skb(skb);
+		goto outl;
+	}
+
 	skb_scrub_packet(skb, !net_eq(pch->chan_net, pchb->chan_net));
 	if (!pchb->chan->ops->start_xmit(pchb->chan, skb))
 		kfree_skb(skb);
-- 
2.43.0
Technical Details
Message-ID: <20261021023608.55867-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-349725-linux-kernel-netdev=dewy.ru

Show 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-349725-linux-kernel-netdev=dewy.ru
From: qingfang.deng@linux.dev (Qingfang Deng)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] ppp: linearize bridged packets when required
Date: Wed, 21 Oct 2026 10:36:06 +0800
Organization: Usenet Network
Message-ID: <20261021023608.55867-1-qingfang.deng@linux.dev>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="4020244"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7joGddc96BDdiy0tnQrhLsiJ3tY= sha256:MHXTvBJaDMftZjWIQFmayzxRzuSGg91n38B98VfNEFc=
	sha1:BT7uB68A2mtJz4BMyYFKQ0hlbRU= sha256:I38x32J96ZZ8rGF/ybxfTMARSt0tkQqC10iCXOEoumg=
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 D26EC110EE7; Wed, 21 Oct 2026 05:40:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, URIBL_BLOCKED=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 QycgKKd9vzET;
	Wed, 21 Oct 2026 05:40:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349725-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 B81C2110EDD; Wed, 21 Oct 2026 05:39:57 +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 6DD113B1F4; Wed, 21 Oct 2026 02:36:26 +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=1792550186;
	b=pEvWFCid/S17hC2MpxqMv4/mrxYK+Afi2H7qWhVYatDGdCcTN6KuN7KqwvkrGJ2Jgss0
	 +SmvdSg3V0sCm9/P20Cc8nKE2s4U3dqYOHjg1FgFpbOvjan8ZW08JYBbk5EgSGVOskpgZ
	 g6FGaoVKbsNtnfW0sCPfDRtcOpWboNAvMnemWB7Pt1P0wbeRVn3EJcZXrNKSi5tDtaIdu
	 Y3iGAj3QL3ZSplXFkA9X3th0q9c70QzIAg2iUN4bU3fUTT5H+He1RsXjRUggg6+T0N4+G
	 TCR3YWoS7h+oL50uCY8PpKhCdocTyLcnLxoYFDRnNk75aZyW1HhLc5wbeWWZv2ZqIIw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792550186;
	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:Cc:
	 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=GR124ABTP8hVFzVqn+1Ol538eubHOFABWIZhnPlfz1s=;
	b=SfKUjdyojQGSaw3fIUUCf9DX1vZM4/G5NAJ5aqMwjhkSTAi2KbYc9gLsmeFaQWdruy89
	 sYBPw4BIz9KqcMGt4G9mRu546FOYFgu/lG3faCyUQIkspv6oyi1d5P12Gw/buQ6oY0SP7
	 135TdoIQEIMK1a20X+lJZQbESgY3UTIJHSTSP5Hd7c5LsyONsavIRwLBrKSx0/KnO3PBS
	 +czJiGD/j4QtRd77wHb6xpEBEw3MdeUNFTfSf+Wt0yKMLhkRMcrn3m+IXYgvJe+uTjm+/
	 xe88WMSERvx6PvbynebxaAR6Fu/b1MVdpGr2QOwsgX0+MKspMWy19KCaY5FjZoo82Zg==
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=K5HXAtfv;
	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 1EEA2606A321;
	Wed, 21 Oct 2026 02:36:26 +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=K5HXAtfv
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.91
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792550184;
	b=UdTKYGeK7VNFZEdtiUdzFp3LUZKsitlZIqU99tD8zG+p9Vt46oLH+Fpqrpkbljb+GuHH
	 KAjTgfwULXWPqU0R+jPWhY9fKxUSSQr3gJc35B4BPnmt7tPx1t/enw6tgKLLtzeSgJxze
	 fDNErjrHMHN2sgnHr4tFjL5rIz/x7/XTTN0UzNxokzkHRNl/46/4oGRueiqJ8but6em3l
	 19yX9xfoScumyCXKSsydVU1J1iuBqZTmh5+aTwHHB0Xxxih7OVJp7oPpPGwFIqRIglEXG
	 g1U3vPg6vwR7kA90ld3A9ZsncynqzpGtt4fygUz6n5sP53fdgN4QZAlOBsdVE/dWAUQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792550184;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:MIME-Version:Content-Transfer-Encoding;
	bh=GR124ABTP8hVFzVqn+1Ol538eubHOFABWIZhnPlfz1s=;
	b=4CuhEMmM3RI7o+Kp/+UmExYmfDS9suhRaQomJUqXBhc2SCMS5uBdNO+0T9qZXX9zHWI1
	 YdFeQkx8HvsifM74DfM0NEpLGwuifnDSjmIXGoJSddUJ1XnaBX24n/9zNFVXLfUZePRo5
	 XrHmNKYLq6tKWXd+lAMblR/+bgRxoyR1y485pI+yLr8SezSKrv/M4ryxSSKoQ/ENuOEcz
	 n+3D22LcT7j/lNO8qwkuQ5gihfRXmM1C48RCRT70/70s19CGhNvtdI3flf0GKJdOkoIPE
	 A9tzXG2G8+Wjj6afEM+65dy3rFyqM/CD90aikhSC7q7ornyJHStbqdOAk1ZybT+qLUQ==
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=K5HXAtfv;
	arc=none smtp.remote-ip=91.218.175.91
X-Received: from mta0.migadu.com (out-91.mta0.migadu.com [91.218.175.91])
	(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 C817D606A31B
	for <netdev@vger.kernel.org>; Wed, 21 Oct 2026 02:36:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C817D606A31B
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=sSx8B/MoT7F+YR3WxVCNi4OfBeJXfUbzIEWDqSFIibo=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1792550176; v=1; x=1793154976;
 b=K5HXAtfvFriKmutRRMVtanU08/Z/OMNmgxf+kb1ufISeHSY8qPLy6q+8FKvsMFUJrPD4IYJw
 F+jBEeMiDNjq2BbQ5oZixahqS/Kkf5KKpJAK4JDTPWGUU0XSTsOaOy8RO7k05tlDVByWKrxVkB+
 bXwWqnP/wJKQ+hnV7bqxlWsA=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id 65086cd44d755d15;
	Wed, 21 Oct 2026 02:36:16 +0000
X-Mizu-Trace-ID: 65086cd44d755d15
X-Migadu-Flow: FLOW_OUT
X-Cc: James Chapman <jchapman@katalix.com>,
	Sashiko <sashiko-bot@kernel.org>
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