From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.169 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== 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== 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 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 ; Tue, 1 Dec 2026 03:18:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BA539606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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-Envelope-To: netdev@vger.kernel.org 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 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 Message-ID: Date: Tue, 1 Dec 2026 11:18:22 +0800 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net v2] pppox: drop queued packets on channel handoff To: Nicolas Dichtel Cc: netdev@vger.kernel.org, stable@vger.kernel.org, "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Andrew Lunn , James Chapman , Willem de Bruijn , Simon Horman References: <20261130101628.1560335-1-nicolas.dichtel@6wind.com> From: Qingfang Deng In-Reply-To: <20261130101628.1560335-1-nicolas.dichtel@6wind.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.