* [PATCH net] pptp: drop packets received before connect
@ 2026-08-11 7:49 Qingfang Deng
2026-08-13 0:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Qingfang Deng @ 2026-08-11 7:49 UTC (permalink / raw)
To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Kees Cook, Qingfang Deng, Dmitry Kozlov, netdev,
linux-kernel
pptp_bind() publishes the socket by its local call ID before it is
connected, so GRE packets can reach pptp_rcv_core() while
PPPOX_CONNECTED is clear.
Such packets are queued on sk_receive_queue, but PPTP provides no recvmsg
operation and never drains the queue after connect. The packets therefore
remain there until socket destruction.
Drop such packets immediately instead. Since PPTP no longer queues packets
on sk_receive_queue, remove the corresponding destructor purge.
Assisted-by: Codex:GPT-5.6
Fixes: 00959ade36ac ("PPTP: PPP over IPv4 (Point-to-Point Tunneling Protocol)")
Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
drivers/net/ppp/pptp.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ppp/pptp.c b/drivers/net/ppp/pptp.c
index cc8c102122d8..a797a0606f6b 100644
--- a/drivers/net/ppp/pptp.c
+++ b/drivers/net/ppp/pptp.c
@@ -278,11 +278,8 @@ static int pptp_rcv_core(struct sock *sk, struct sk_buff *skb)
__u8 *payload;
struct pptp_gre_header *header;
- if (!(sk->sk_state & PPPOX_CONNECTED)) {
- if (sock_queue_rcv_skb(sk, skb))
- goto drop;
- return NET_RX_SUCCESS;
- }
+ if (!(sk->sk_state & PPPOX_CONNECTED))
+ goto drop;
header = (struct pptp_gre_header *)(skb->data);
headersize = sizeof(*header);
@@ -539,7 +536,6 @@ static void pptp_sock_destruct(struct sock *sk)
del_chan(pppox_sk(sk));
pppox_unbind_sock(sk);
}
- skb_queue_purge(&sk->sk_receive_queue);
dst_release(rcu_dereference_protected(sk->sk_dst_cache, 1));
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] pptp: drop packets received before connect
2026-08-11 7:49 [PATCH net] pptp: drop packets received before connect Qingfang Deng
@ 2026-08-13 0:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-13 0:30 UTC (permalink / raw)
To: Qingfang Deng
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, kees, xeb, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 11 Aug 2026 15:49:47 +0800 you wrote:
> pptp_bind() publishes the socket by its local call ID before it is
> connected, so GRE packets can reach pptp_rcv_core() while
> PPPOX_CONNECTED is clear.
>
> Such packets are queued on sk_receive_queue, but PPTP provides no recvmsg
> operation and never drains the queue after connect. The packets therefore
> remain there until socket destruction.
>
> [...]
Here is the summary with links:
- [net] pptp: drop packets received before connect
https://git.kernel.org/netdev/net-next/c/a0d6255b4adc
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-13 0:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 7:49 [PATCH net] pptp: drop packets received before connect Qingfang Deng
2026-08-13 0:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox