pipewire/spa/plugins
Barnabás Pőcze 16f63a3c8f Revert "loop: remove destroy list"
This reverts commit c474846c42.
In addition, `s->loop` is also checked before dispatching a source.

The destroy list is needed in the presence of threads. The
issue is that a source may be destroyed between `epoll_wait()`
returning and thread loop lock being acquired. If this
source is active, then a use-after-free will be triggered
when the thread loop acquires the lock and starts dispatching
the sources.

  thread 1                       thread 2
 ----------                     ----------
                                loop_iterate
                                  spa_loop_control_hook_before
                                    // release lock

 pw_thread_loop_lock

                                  spa_system_pollfd_wait
                                    // assume it returns with source A

 pw_loop_destroy_source(..., A)
  // frees storage of A

 pw_thread_loop_unlock
                                  spa_loop_control_hook_after
                                    // acquire the lock

                                  for (...) {
                                    struct spa_source *s = ep[i].data;
                                    s->rmask = ep[i].events;
                                      // use-after-free if `s` refers to
                                      // the previously freed `A`

Fixes #2147
2022-02-18 20:31:14 +01:00
..
aec fix compilation 2022-02-17 16:11:22 +01:00
alsa alsa: don't read more than available samples 2022-02-16 21:30:54 +01:00
audioconvert spa: clamp required alignment to cpu alignment 2022-01-28 11:49:06 +01:00
audiomixer spa: clamp required alignment to cpu alignment 2022-01-28 11:49:06 +01:00
audiotestsrc Use configured quantum_limit instead of hardcoded value 2022-01-12 17:50:12 +01:00
bluez5 spa: bluez: remove unused function 2022-02-10 23:20:47 +01:00
control buffers: make alignment optional 2022-01-03 12:32:26 +01:00
ffmpeg treewide: meson.build: use dependency variable for SPA 2021-12-28 18:34:06 +01:00
jack buffers: make alignment optional 2022-01-03 12:32:26 +01:00
libcamera buffers: make alignment optional 2022-01-03 12:32:26 +01:00
support Revert "loop: remove destroy list" 2022-02-18 20:31:14 +01:00
test buffers: make alignment optional 2022-01-03 12:32:26 +01:00
v4l2 meson: enable some more warnings 2022-01-27 11:07:17 +01:00
videoconvert buffers: make alignment optional 2022-01-03 12:32:26 +01:00
videotestsrc buffers: make alignment optional 2022-01-03 12:32:26 +01:00
volume Use configured quantum_limit instead of hardcoded value 2022-01-12 17:50:12 +01:00
vulkan buffers: make alignment optional 2022-01-03 12:32:26 +01:00
meson.build module-echo-cancel: Move backends to dynamic libaries 2022-02-15 15:45:46 +00:00