All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] net: make client cleanup callbacks idempotent
@ 2026-12-04 10:43 David Woodhouse
  2026-12-04 10:43 ` [PATCH 1/5] net: Make slirp cleanup idempotent David Woodhouse
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: David Woodhouse @ 2026-12-04 10:43 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jason Wang, Michael S . Tsirkin, Stefano Garzarella,
	Samuel Thibault, qemu-stable, David Woodhouse

From: David Woodhouse <dwmw@amazon.co.uk>

A backend whose deletion was deferred because its peer NIC still owned
it has its cleanup callback invoked from both net_cleanup() and
qemu_del_nic(). For NICs deleted at runtime only one of those paths
runs, but the xen-net-device NIC is deleted from the XenDevice exit
notifier, which runs *after* net_cleanup(): the backend cleanup runs
twice, and for slirp the second invocation walks and frees the Slirp
state again ("double free or corruption"). Trivially reproducible with
a bare -device xen-net-device,netdev=... and quitting.

Patch 1 documents it as a property of the NetCleanup contract that
callbacks cope with being invoked more than once, and fixes slirp —
the one which actually crashed. That one wants to go into 11.2 and the
stable branches.

The rest follow one driver at a time in roughly decreasing order of
reachability: vde and l2tpv3 can also peer an arbitrary NIC, while
passt and vhost-vdpa are restricted by their check_peer_type to
virtio-net and cannot currently be reached twice.

As with the Xen series already merged: written by an LLM-based coding
agent under my direction, reviewed, edited and tested by me, posted in
anticipation of the pending AI contribution policy change.


David Woodhouse (5):
  net: Make slirp cleanup idempotent
  net: Make vde cleanup idempotent
  net: Make l2tpv3 cleanup idempotent
  net: Make passt cleanup idempotent
  net: Make vhost-vdpa cleanup idempotent

 include/net/net.h |  8 ++++++++
 net/l2tpv3.c      | 10 +++++++++-
 net/passt.c       | 18 +++++++++++++-----
 net/slirp.c       | 20 +++++++++++++++++++-
 net/vde.c         |  6 ++++++
 net/vhost-vdpa.c  | 14 ++++++++++----
 6 files changed, 65 insertions(+), 11 deletions(-)

-- 
2.43.0



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

end of thread, other threads:[~2026-12-05  0:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 10:43 [PATCH 0/5] net: make client cleanup callbacks idempotent David Woodhouse
2026-12-04 10:43 ` [PATCH 1/5] net: Make slirp cleanup idempotent David Woodhouse
2026-12-05  0:40   ` Samuel Thibault
2026-12-04 10:43 ` [PATCH 2/5] net: Make vde " David Woodhouse
2026-12-04 10:43 ` [PATCH 3/5] net: Make l2tpv3 " David Woodhouse
2026-12-04 10:43 ` [PATCH 4/5] net: Make passt " David Woodhouse
2026-12-04 10:43 ` [PATCH 5/5] net: Make vhost-vdpa " David Woodhouse

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.