mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/2] wireguard: memcg accounting and initiation race fix
@ 2026-11-05 14:10 Alexander Ildiyarov
  2026-11-05 14:10 ` [PATCH net 1/2] wireguard: account peer and allowedips allocations to memcg Alexander Ildiyarov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alexander Ildiyarov @ 2026-11-05 14:10 UTC (permalink / raw)
  To: Jason A . Donenfeld, wireguard, netdev
  Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, linux-kernel, Alexander Ildiyarov

  Two independent fixes:
  
  1/2 charges peer, allowedips, dst_cache and hashtable allocations to the
  memcg of the configuring process, which currently can allocate
  unaccounted kernel memory through WG_CMD_SET_DEVICE.
  
  2/2 rechecks the replay/flood conditions under the write lock in
  wg_noise_handshake_consume_initiation(), the initiation-side counterpart
  of 2a73c9b2c0ca. The race window is narrow and was only reproduced with
  an artificial delay; details are in the commit message.
  
  Tested in qemu (x86_64, 4 vCPUs) with reproducers for both issues and
  CONFIG_WIREGUARD_DEBUG self-tests. netns.sh was run up to the
  allowed-ips removal step, where the available wg(8) is too old; that
  part was not run.


Alexander Ildiyarov (2):
  wireguard: account peer and allowedips allocations to memcg
  wireguard: noise: recheck replay and flood under write lock on
    initiation

 drivers/net/wireguard/allowedips.c |  2 +-
 drivers/net/wireguard/noise.c      | 29 ++++++++++++++++++++++-------
 drivers/net/wireguard/peer.c       |  4 ++--
 drivers/net/wireguard/peerlookup.c |  4 ++--
 4 files changed, 27 insertions(+), 12 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-05 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-05 14:10 [PATCH net 0/2] wireguard: memcg accounting and initiation race fix Alexander Ildiyarov
2026-11-05 14:10 ` [PATCH net 1/2] wireguard: account peer and allowedips allocations to memcg Alexander Ildiyarov
2026-11-05 14:10 ` [PATCH net 2/2] wireguard: noise: recheck replay and flood under write lock on initiation Alexander Ildiyarov
2026-11-05 14:14 ` [PATCH net 0/2] wireguard: memcg accounting and initiation race fix 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®