🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24941

Re: [PATCH net v2] pppox: drop queued packets on channel handoff

#24941
From: Qingfang Deng
Date: Tue, 01 Dec 2026 03:18
40 lines
9741 bytes
Hi,

On 2026/11/30 18:16, Nicolas Dichtel wrote:
> diff --git a/drivers/net/ppp/pppox.c b/drivers/net/ppp/pppox.c
> index a6f72c813bef..392320d01abf 100644
> --- a/drivers/net/ppp/pppox.c
> +++ b/drivers/net/ppp/pppox.c
> @@ -74,7 +74,6 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
>   
>   	switch (cmd) {
>   	case PPPIOCGCHAN: {
> -		struct sk_buff *skb;
>   		int index;
>   
>   		rc = -ENOTCONN;
> @@ -92,17 +91,10 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
>   		 * /dev/ppp.
>   		 */
>   		sk->sk_state |= PPPOX_BOUND;
> -		/* Let lockless receive paths finish queueing against the old
> -		 * state.
> +		/* A bound socket is no longer readable: drop the packets
> +		 * queued before the handoff.
>   		 */
> -		synchronize_net();
> -		/* Drain packets queued before the handoff because a bound
> -		 * socket is no longer readable.
> -		 */
> -		while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
> -			skb_orphan(skb);
> -			ppp_input(&po->chan, skb);
> -		}
> +		skb_queue_purge(&sk->sk_receive_queue);

pppoe_rcv() runs concurrently and may have observed the old state, and 
can queue more packets to this queue after the purge, which was the 
reason for the synchronize_net().

Therefore a non-blocking call_rcu() is still required.
Technical Details
Message-ID: <e0be837d-0441-475d-aee7-401209cfd2a5@linux.dev>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374672-linux-kernel-netdev=dewy.ru
References: <20261130101628.1560335-1-nicolas.dichtel@6wind.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374672-linux-kernel-netdev=dewy.ru
From: qingfang.deng@linux.dev (Qingfang Deng)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] pppox: drop queued packets on channel handoff
Date: Tue, 1 Dec 2026 11:18:22 +0800
Organization: Usenet Network
Message-ID: <e0be837d-0441-475d-aee7-401209cfd2a5@linux.dev>
References: <20261130101628.1560335-1-nicolas.dichtel@6wind.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1600968"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nqdH4pSOnh+X82Hbh4Y0PBL/obs= sha256:RPyacMuIvqZNEvLAiIIXagKwn5FBPX8V69EJHccpxTQ=
	sha1:+A7rWrOV8mNC44o7tWdMiqF8Xpo= sha256:l8kqEMogMI5vmg6IJCiv/mWGOQ1E/6ET5mzFGlPM5sU=
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 2962A117220; Tue,  1 Dec 2026 06:18:52 +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.249,
	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 70t8Ehaynihb;
	Tue,  1 Dec 2026 06:18:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-374672-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 3321E11721E; Tue,  1 Dec 2026 06:18:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 555BA24111; Tue,  1 Dec 2026 03:18:36 +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=1796095113;
	b=XWKp8wXnQZUsOM6ugfnoZjqwIYzN3ijtMul7caXqxEiv8Wkew1QBp8Hi/8bE6/lCW7BL
	 FffL5u9bXU7LFRgHHqWss4KWAIf6mafaqIsnuo/8fM6qobS68pJ0JkRJLIsMoNbr5/EGK
	 kCFaZ0eKYFuvmvrfedp2TgP8V0Dgs9w10N8nYFDb4EA7fvCx7QSOgjkDfq4Hzyar0iX+l
	 uzwuKB9pNUlH0IL5IVnh1cDgwPb4k3iefXQPKeko9FrSX57ukVPO2CK0TujSYjb6gbguo
	 CiJiBZMZgO+a9ktfaCyI0Sss4tOOeps5CQiwzbvCxaCL/738dNpeTLgoTxZORr0Ym6A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796095113;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=uiUJ3DrcvWRrtNdy+heBVWrC+Y/1sMAIwKvnhPmxx2M=;
	b=YKXdqb0/Eu3dGW7E+b7s4XELC2lFDREGdfkaw+FX0uy8SvEkYvt/rPzK/YCS48cmE/ZL
	 Uh49rkgzIO+GUlgcM2zVtpXTLsXYiUK/4gtdIpYg4ZmrPXAJw7Bf2oVkVy/jASKm6opAe
	 cQ2uX5BXe5yG6e+tnKXgixO18yXIhudzK6lVi7atpfL5327ZCTDDZaVG1/DE2LdLGc8dG
	 EImtKuR9lomovoiBJ16ks1Dth/ZzGRFD7wQAm2zHHSl7Q+sY+IqxVjoaFIEPmI5tZdhuz
	 Vbvk0BWyYVACXVY57U8JhPUgGYfBC3eh14wGDI1OHQIfor6UozhNXbOR+ynr4MInGAw==
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=c7a7PTrJ;
	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 54F70606A32E;
	Tue,  1 Dec 2026 03:18:33 +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=c7a7PTrJ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.169
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796095112;
	b=4lXDpdnPS0VeKcUEYflrVDpLIBnlYO9Ps/ArOk6VPwVMOzduN3hX0A8C0u1BXdU5BbLv
	 CmW/XTWO6UFdqiSEe8NcigsPEfiB9IT8lsIacwM9oPCkqtZHm8ymngR6KtIkkghjL9vdt
	 j6bjT4U9ZjIxhrtPCyVvPjufIGv8liSI3Mlh6UFNmaDclERngVvw87StX1mw7ABt8UDuY
	 wjJdtmbyHECSlQ2Tr4eCXDX55NtsFdiVlsKXqD8fPqMQJupI/17eNC/o+3TDrqimDBmXL
	 WWHLMcuEfP3dPPVc6rzAu2vcIZUMymXx9aPoTcA9QDaYylp3Fx+UyMgEyxRjYO/4/qQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796095112;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=uiUJ3DrcvWRrtNdy+heBVWrC+Y/1sMAIwKvnhPmxx2M=;
	b=dx89pc374Q50njfy6pLpMKN830e6xIg3P6Teb6MlQaG10JHqYhJmia8kJSrQYJvtcZOV
	 wIf3Q0LIhRMg8GOu4pAd2yhrP1V+pQtb4Q12bBAK7TusMi02fEU697rAuqXV7jojYHg4A
	 SQnoPBCZYzIHHYl+ViVbH3ugYOQ9lAp3v2H+mU9zgD8m70IbJTuQwU6vdyGh26QGRhkNF
	 CDhjuO0ddLQGr/PTjIeG7jMeWWHhai5NEe/s+V0bzWU6A/XZaeljEDadNdyy1CYnvSUty
	 sxzGjBoJYPap+eoppcpjihi0fmIBvB9b9LpnoopfUDNABcmZ7Ydm58GDnX/hkM2Yl4A==
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=c7a7PTrJ;
	arc=none smtp.remote-ip=95.215.58.169
X-Received: from mta1.migadu.com (out-169.mta1.migadu.com [95.215.58.169])
	(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 BA539606A320
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 03:18:30 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA539606A320
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=s4r8p6jWjR4rBwjHStrKHj02pSzxbYTrFWPMFv6ViDU=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1796095109; v=1; x=1796699909;
 b=c7a7PTrJ+ewPbqEujPGzd3MNcG0IItdGJ+4TpQDtuGpz17gK607DdNnlPEhp5VKKVUo/+lM6
 Ole2tyFVLMBP85spaV7xk3zzo6Ma1woa3gsGbuyFIpn0FhX9gkEDXyQCgQ/YWrkxRX8TWIQ45VL
 6elXgke0OE8+4tx0JOb6Co74=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id a363dd6b73c27f7c;
	Tue, 01 Dec 2026 03:18:29 +0000
X-Mizu-Trace-ID: a363dd6b73c27f7c
X-Migadu-Flow: FLOW_OUT
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
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, stable@vger.kernel.org,
 "David S . Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>,
 Paolo Abeni <pabeni@redhat.com>, Eric Dumazet <edumazet@kernel.org>,
 Andrew Lunn <andrew+netdev@lunn.ch>, James Chapman <jchapman@katalix.com>,
 Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>
X-In-Reply-To: <20261130101628.1560335-1-nicolas.dichtel@6wind.com>