sway/sway/desktop
llyyr 1084d2e87a sway/desktop/transaction: skip freeing dirty nodes
This fixes a race that causes UAF when turning on multiple outputs after
they've been off for a while.

When output_begin_destroy is called while a transaction that references
the output is in-flight, node_set_dirty adds the node to
server.dirty_nodes list and ntxnrefs is still held by that transaction.
Once the transaction completes and ntxnrefs drops to 0,
transaction_destroy frees the output, leaving a dangling pointer in
server.dirty_nodes. The next transaction_commit_dirty call then walks
the dirty_nodes list and crashes

The fix is to skip the free in transaction_destroy if node->dirty is
set, this means transaction_commit_dirty hasn't processed this node yet
and will bump ntxnrefs shortly. The free will happen once that
transaction completes and ntxnrefs reaches 0 again and
transaction_commit_dirty will allocate a fresh instruction and
increment ntxnrefs again when it processes the node.
2026-04-26 11:23:20 +02:00
..
idle_inhibit_v1.c desktop/idle_inhibit: remove event listeners on destroy 2025-04-13 23:40:56 +02:00
launcher.c Revert "sway/tree: Simplify sway_node teardown" 2025-06-28 11:26:49 +02:00
layer_shell.c layer-shell: handle popup reposition for unconstraining 2026-02-28 22:56:37 +01:00
output.c Revert "sway/tree: Simplify sway_node teardown" 2025-06-28 11:26:49 +02:00
tearing.c tearing: fix UAF on destroy 2024-08-07 14:33:03 +02:00
transaction.c sway/desktop/transaction: skip freeing dirty nodes 2026-04-26 11:23:20 +02:00
xdg_shell.c desktop/xdg_shell: skip configure in request_maximize handler if unmapped 2025-12-21 16:38:06 +01:00
xwayland.c commit dirty transactions upon window attribute changes 2025-11-22 16:35:19 +01:00