pipewire/src
Pauli Virtanen a0a5320280 impl-client: check global id registry generation in client.error method
In client.error method, require that the global id in the message refers
to an existing registered global known to the sender of the message.  If
not, do not try forwarding errors to the resources.

Also emit errors on the sender client resource in this case, so that the
sender client gets to know that what it tried to do didn't work.

This addresses a race condition where session manager sends a client
error for a global id, but before server processed that message the
global got deleted and the id reused for a different object, resulting
to an error being sent to the wrong resource. See #3192.

Wireplumber & pipewire-media-session do this on non-reconnectable node
connection failures: they first delete the node, and then try to send a
client error for its id. However, the global and its resources then
usually are already deleted at that point, and there are no resources to
send messages to so that is a no-op, except in the race condition where
id gets reused and the message goes to the wrong object.

They should do it in the opposite order. That it is wrong is also
visible in that

pw-play --target badtarget -P '{ node.dont-reconnect = true }' sample.ogg

hangs instead of bailing out, which is what happens also before this
commit.
2023-05-06 19:05:12 +03:00
..
daemon jack: Add jack.max-client-ports config option 2023-04-21 15:42:57 +02:00
examples core: add bound_props event 2023-03-21 17:22:27 +01:00
gst gst/pipewiresrc: Let GstBaseSrc handle pseudo-live calculations 2023-04-19 19:22:24 +00:00
modules module-combine-stream: fix race when destroying streams 2023-05-06 07:24:31 +00:00
pipewire impl-client: check global id registry generation in client.error method 2023-05-06 19:05:12 +03:00
tests core: add bound_props event 2023-03-21 17:22:27 +01:00
tools profiler: improve profiler stats 2023-05-06 10:54:57 +02:00
meson.build treewide: meson.build: use feature.allowed() 2022-02-04 00:15:59 +01:00