pipewire/spa/plugins/support
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
..
cpu-arm.c cpu: disable VFP asm when not available 2021-10-25 16:32:16 +02:00
cpu-x86.c cpu: only run SSE code when supported 2021-11-02 20:12:35 +01:00
cpu.c cpu: fix compilation on some architectures 2021-10-21 11:09:48 +02:00
dbus.c dbuf: use log topic 2021-10-03 12:27:20 +02:00
evl-plugin.c Add evl system support 2019-06-24 09:42:05 +02:00
evl-system.c treewide: replace strcmp() == 0 with spa_streq() 2021-05-18 22:10:27 +10:00
journal.c spa: support: do not include C source file 2021-09-29 15:07:36 +00:00
log-patterns.c json: spa_json_get_string() writes up to len chars or fail 2022-01-04 10:42:32 +01:00
log-patterns.h spa: support: do not include C source file 2021-09-29 15:07:36 +00:00
logger.c support: close log file when we opened it 2022-02-08 11:30:39 +01:00
loop.c Revert "loop: remove destroy list" 2022-02-18 20:31:14 +01:00
meson.build treewide: meson.build: use feature.allowed() 2022-02-04 00:15:59 +01:00
node-driver.c support: add property to configure clock name 2021-12-10 11:22:23 +01:00
null-audio-sink.c Use configured quantum_limit instead of hardcoded value 2022-01-12 17:50:12 +01:00
plugin.c support: add null audio sink 2020-08-20 18:00:00 +02:00
system.c spa: sprinkle more log topics into spa 2021-09-28 09:35:39 +02:00