All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qingfang Deng <qingfang.deng@linux.dev>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
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>
Subject: Re: [PATCH net v2] pppox: drop queued packets on channel handoff
Date: Tue, 1 Dec 2026 11:18:22 +0800	[thread overview]
Message-ID: <e0be837d-0441-475d-aee7-401209cfd2a5@linux.dev> (raw)
In-Reply-To: <20261130101628.1560335-1-nicolas.dichtel@6wind.com>

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.


      reply	other threads:[~2026-12-01  3:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:16 [PATCH net v2] pppox: drop queued packets on channel handoff Nicolas Dichtel
2026-12-01  3:18 ` Qingfang Deng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0be837d-0441-475d-aee7-401209cfd2a5@linux.dev \
    --to=qingfang.deng@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=jchapman@katalix.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.dichtel@6wind.com \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.