From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6C9B39FCCA; Sat, 12 Sep 2026 20:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789243361; cv=none; b=mSuUByIvgkTuFmcTp8Qk8NRjxyxH2CjM2Fd5J8fhmDLixxFmoqON1Lo4kMnajq88NClbmP6npOehP0MV3WqxoRa2DFGlesRqF0QiuVmVCajADNwZzkoc99THI2uGmBLKUtshffSIsqzCR1oFynRVMq0BhjYXpwEjQx8W+vVp7c0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789243361; c=relaxed/simple; bh=YWQxewp/FkCJ+IcOL/Hk6DbhwW/gbvwHtxzliBh1ev4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eHqGSes2h3zKrj6Y0HtqlQOg26d93VTBAKezgJJ0/R4CczovW9jPAIlFMmZpnz138QbUbMZi2acaTeJJRkaklC64ePvDIQ0nOURDketC+GPzaXGG+JZcubjjsCkdbADHXcSikUwUoPcB2/QvloXK6fmOhChAIrnzXQkpjJlmCkE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VbdtGlCe; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VbdtGlCe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7EB91F000FF; Sat, 12 Sep 2026 20:02:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789243356; bh=xdSB9HeRbTWxYgJGxBii/bS0wjILAJHsQIpQlrpTis4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VbdtGlCeh9O4jiIklAfu4JUmAN+/YktlaFvIUJzpZ7htNThu4J4rRm/P4/PbDRVpi 7UomgMQFCYGSorLEhYMshSZLc7n4jSQoPoFrD9dXZ9d/lIt8nPrH+Kko3fT29AXWnK UoHBLDE6Jq3ENq5z5kF49KsCHn5yekf2fpradhg8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qingfang Deng , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 726/798] pppox: drain queued packets on channel handoff Date: Sat, 12 Sep 2026 09:05:54 +0200 Message-ID: <20260912065533.720533607@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065516.948645775@linuxfoundation.org> References: <20260912065516.948645775@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Qingfang Deng [ Upstream commit 92c1bf630abf0af646562398eaa36f80b5ff677d ] PPPIOCGCHAN both returns the channel index and marks a PPPOX socket as bound to generic PPP, despite its getter semantic. Packets received before that transition are queued on sk_receive_queue, but a bound socket is no longer readable. Such packets therefore remain queued until the socket is destroyed. After marking a socket bound, wait for receive paths that observed the old state to finish queueing packets, and then drain the queue into generic PPP. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Qingfang Deng Link: https://patch.msgid.link/20260811035314.302878-1-qingfang.deng@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ppp/pppox.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/ppp/pppox.c b/drivers/net/ppp/pppox.c index 08364f10a43fa..61b3453469dce 100644 --- a/drivers/net/ppp/pppox.c +++ b/drivers/net/ppp/pppox.c @@ -74,7 +74,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) switch (cmd) { case PPPIOCGCHAN: { + struct sk_buff *skb; int index; + rc = -ENOTCONN; if (!(sk->sk_state & PPPOX_CONNECTED)) break; @@ -85,7 +87,22 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) break; rc = 0; + /* PPPIOCGCHAN historically marks the userspace handoff to + * generic PPP; pppd then attaches the returned channel to + * /dev/ppp. + */ sk->sk_state |= PPPOX_BOUND; + /* Let lockless receive paths finish queueing against the old + * state. + */ + 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); + } break; } default: -- 2.53.0