mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v2 0/2] wireguard: free queued packets on peer removal, and test it
@ 2026-11-26  9:47 Andrii Pasichnyk
  2026-11-26  9:47 ` [PATCH net v2 1/2] wireguard: peer: free packets left on the per-peer queues on removal Andrii Pasichnyk
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrii Pasichnyk @ 2026-11-26  9:47 UTC (permalink / raw)
  To: Jason A . Donenfeld
  Cc: wireguard, netdev, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Shuah Khan, linux-kselftest,
	linux-kernel

Removing a peer while its receive queue is busy can leave packets on the
per-peer queues. Each of them holds a keypair and a peer reference, so
the peer and the keypair are never freed. Patch 1 frees what is left;
patch 2 adds the test Jason asked for in the v1 thread to netns.sh.

Tested on net e50972666 with the WireGuard selftest VM (x86_64 KVM):

  both patches, 4 vCPUs:      pass
  both patches, NR_CPUS=1:    pass
  patch 2 only, NR_CPUS=1:    fail, 4 peers and 4 keypairs
                              "merely created" in 10 removals

Changes in v2:
- Patch 1: code unchanged. The reproduction paragraph in the commit
  message is corrected: the first reproducer only put load on the first
  removal of each run, so "5 in 2140" understated how often this
  happens. Under load it is 25-40% of removals with 1 vCPU.
- Patch 2: new, the netns.sh loop from my reply in the v1 thread plus
  the larger log buffer it needs.
- Rebased on current net.

v1: https://lore.kernel.org/netdev/20261003201625.4572-1-apasichnik9@gmail.com/

Andrii Pasichnyk (2):
  wireguard: peer: free packets left on the per-peer queues on removal
  wireguard: selftests: remove a peer under load

 drivers/net/wireguard/peer.c                  | 24 +++++++++++++++++++
 tools/testing/selftests/wireguard/netns.sh    | 14 +++++++++++
 .../selftests/wireguard/qemu/kernel.config    |  2 +-
 3 files changed, 39 insertions(+), 1 deletion(-)


base-commit: e509726660dd06ce107437aecf7c106c9d3fc1e7
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-26  9:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26  9:47 [PATCH net v2 0/2] wireguard: free queued packets on peer removal, and test it Andrii Pasichnyk
2026-11-26  9:47 ` [PATCH net v2 1/2] wireguard: peer: free packets left on the per-peer queues on removal Andrii Pasichnyk
2026-11-26  9:47 ` [PATCH net v2 2/2] wireguard: selftests: remove a peer under load Andrii Pasichnyk
2026-11-26  9:52 ` [PATCH net v2 0/2] wireguard: free queued packets on peer removal, and test it netdev-bot+sinfo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®