Accepting request 956506 from home:XRevan86

- Update to version 0.3.47.

OBS-URL: https://build.opensuse.org/request/show/956506
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/pipewire?expand=0&rev=49
This commit is contained in:
Antonio Larrosa 2022-03-01 18:02:45 +00:00 committed by Git OBS Bridge
parent 45e87da2cb
commit b8474363d8
9 changed files with 283 additions and 47 deletions

View File

@ -0,0 +1,116 @@
From 16f63a3c8fa227625bade5a9edea22354b347d18 Mon Sep 17 00:00:00 2001
From: Barnabás Pőcze <pobrn@protonmail.com>
Date: Fri, 18 Feb 2022 18:36:36 +0100
Subject: [PATCH] Revert "loop: remove destroy list"
This reverts commit c474846c42967c44db069a23b76a29da6f496f33.
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
---
spa/plugins/support/loop.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c
index 0588ce770..04739eb2a 100644
--- a/spa/plugins/support/loop.c
+++ b/spa/plugins/support/loop.c
@@ -75,6 +75,7 @@ struct impl {
struct spa_system *system;
struct spa_list source_list;
+ struct spa_list destroy_list;
struct spa_hook_list hooks_list;
int poll_fd;
@@ -325,6 +326,14 @@ static void loop_leave(void *object)
impl->thread = 0;
}
+static inline void process_destroy(struct impl *impl)
+{
+ struct source_impl *source, *tmp;
+ spa_list_for_each_safe(source, tmp, &impl->destroy_list, link)
+ free(source);
+ spa_list_init(&impl->destroy_list);
+}
+
static int loop_iterate(void *object, int timeout)
{
struct impl *impl = object;
@@ -354,11 +363,14 @@ static int loop_iterate(void *object, int timeout)
}
for (i = 0; i < nfds; i++) {
struct spa_source *s = ep[i].data;
- if (SPA_LIKELY(s && s->rmask)) {
+ if (SPA_LIKELY(s && s->rmask && s->loop)) {
s->priv = NULL;
s->func(s);
}
}
+ if (SPA_UNLIKELY(!spa_list_is_empty(&impl->destroy_list)))
+ process_destroy(impl);
+
return nfds;
}
@@ -712,7 +724,7 @@ static void loop_destroy_source(void *object, struct spa_source *source)
spa_system_close(impl->impl->system, source->fd);
source->fd = -1;
}
- free(source);
+ spa_list_insert(&impl->impl->destroy_list, &impl->link);
}
static const struct spa_loop_methods impl_loop = {
@@ -783,6 +795,8 @@ static int impl_clear(struct spa_handle *handle)
spa_list_consume(source, &impl->source_list, link)
loop_destroy_source(impl, &source->source);
+ process_destroy(impl);
+
spa_system_close(impl->system, impl->ack_fd);
spa_system_close(impl->system, impl->poll_fd);
@@ -844,6 +858,7 @@ impl_init(const struct spa_handle_factory *factory,
impl->poll_fd = res;
spa_list_init(&impl->source_list);
+ spa_list_init(&impl->destroy_list);
spa_hook_list_init(&impl->hooks_list);
impl->buffer_data = SPA_PTR_ALIGN(impl->buffer_mem, MAX_ALIGN, uint8_t);
--
GitLab

View File

@ -0,0 +1,98 @@
From d7793501fd012de37fcc8bf09003c60bc4624341 Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Sun, 20 Feb 2022 21:34:53 +0100
Subject: [PATCH] pulse-server: free pending sample reply
If the sample finished playing before we finished the roundtrip to
get the sink_index, it will be destroyed. When the roundtrip completes,
it will try to use invalid memoryy and crash.
Make sure we destroy all pending replies before destroying the sample
to avoid this problem.
Fixes #2151
---
src/modules/module-protocol-pulse/operation.c | 10 ++++++++++
src/modules/module-protocol-pulse/operation.h | 1 +
src/modules/module-protocol-pulse/pending-sample.c | 5 +++++
src/modules/module-protocol-pulse/pulse-server.c | 4 ++++
4 files changed, 20 insertions(+)
diff --git a/src/modules/module-protocol-pulse/operation.c b/src/modules/module-protocol-pulse/operation.c
index e0e67b374..b1e0eb08d 100644
--- a/src/modules/module-protocol-pulse/operation.c
+++ b/src/modules/module-protocol-pulse/operation.c
@@ -66,6 +66,16 @@ void operation_free(struct operation *o)
free(o);
}
+struct operation *operation_find(struct client *client, uint32_t tag)
+{
+ struct operation *o;
+ spa_list_for_each(o, &client->operations, link) {
+ if (o->tag == tag)
+ return o;
+ }
+ return NULL;
+}
+
void operation_complete(struct operation *o)
{
struct client *client = o->client;
diff --git a/src/modules/module-protocol-pulse/operation.h b/src/modules/module-protocol-pulse/operation.h
index d282ee5e5..1fa07cc7b 100644
--- a/src/modules/module-protocol-pulse/operation.h
+++ b/src/modules/module-protocol-pulse/operation.h
@@ -43,6 +43,7 @@ int operation_new(struct client *client, uint32_t tag);
int operation_new_cb(struct client *client, uint32_t tag,
void (*callback) (void *data, struct client *client, uint32_t tag),
void *data);
+struct operation *operation_find(struct client *client, uint32_t tag);
void operation_free(struct operation *o);
void operation_complete(struct operation *o);
diff --git a/src/modules/module-protocol-pulse/pending-sample.c b/src/modules/module-protocol-pulse/pending-sample.c
index 6e5d04fbb..399fc3b54 100644
--- a/src/modules/module-protocol-pulse/pending-sample.c
+++ b/src/modules/module-protocol-pulse/pending-sample.c
@@ -29,6 +29,7 @@
#include "client.h"
#include "internal.h"
#include "log.h"
+#include "operation.h"
#include "pending-sample.h"
#include "sample-play.h"
@@ -36,10 +37,14 @@ void pending_sample_free(struct pending_sample *ps)
{
struct client * const client = ps->client;
struct impl * const impl = client->impl;
+ struct operation *o;
spa_list_remove(&ps->link);
spa_hook_remove(&ps->listener);
pw_work_queue_cancel(impl->work_queue, ps, SPA_ID_INVALID);
+ if ((o = operation_find(client, ps->tag)) != NULL)
+ operation_free(o);
+
sample_play_destroy(ps->play);
}
diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
index 182c3db99..c035840d1 100644
--- a/src/modules/module-protocol-pulse/pulse-server.c
+++ b/src/modules/module-protocol-pulse/pulse-server.c
@@ -2353,6 +2353,10 @@ static void on_sample_done(void *obj, void *data, int res, uint32_t id)
{
struct pending_sample *ps = obj;
struct client *client = ps->client;
+ struct operation *o;
+
+ if ((o = operation_find(client, ps->tag)) != NULL)
+ operation_complete(o);
pending_sample_free(ps);
client_unref(client);
--
GitLab

View File

@ -3,7 +3,7 @@
<service name="obs_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://gitlab.freedesktop.org/pipewire/pipewire.git</param>
<param name="revision">refs/tags/0.3.46</param>
<param name="revision">refs/tags/0.3.47</param>
<param name="versionformat">@PARENT_TAG@</param>
<!-- <param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@+git%cd.%h</param>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a566bded2566dbfaf3aa7d5ed9ccad092e11df0246a2ce19454bed4ab469911b
size 10480141

3
pipewire-0.3.47.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:25443252f58c801acdc80d88e832994971cc3f600f2f20a29cfa9ade389784e7
size 10481677

View File

@ -1,3 +1,21 @@
-------------------------------------------------------------------
Mon Feb 21 12:24:26 UTC 2022 - Alexei Sorokin <sor.alexei@meowr.ru>
- Add 0001-revert-loop-remove-destroy-list.patch: fix MPD crash.
- Add 0002-pulse-server-free-pending-sample-reply.patch: fix
"fast volume change".
-------------------------------------------------------------------
Fri Feb 18 14:06:20 UTC 2022 - Alexei Sorokin <sor.alexei@meowr.ru>
- Update to version 0.3.47:
* Fix a bug in pulse-server that caused cached notifications to
play multiple times.
* Remove a check and warnings to catch leaked listeners on the
proxy. This might access invalid memory and cause infinite
loops in older wireplumber.
- Rebase reduce-meson-dependency.patch.
-------------------------------------------------------------------
Thu Feb 17 10:42:44 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>
@ -86,7 +104,7 @@ Thu Feb 17 10:42:44 UTC 2022 - Antonio Larrosa <alarrosa@suse.com>
* GStreamer
- GStreamer sink will now set a default channelmap to make it
possible to remap to the channel layout of the device.
- Update patch for further uses of "new" cmake features used by
- Update patch for further uses of "new" meson features used by
upstream:
* reduce-meson-dependency.patch

View File

@ -1,4 +1,4 @@
name: pipewire
version: 0.3.46
mtime: 1645087617
commit: 0df9d037292f7b815be59d265c47790ee7a495c9
version: 0.3.47
mtime: 1645172864
commit: 2af393889358723a2789caa3c856700b1c968ef0

View File

@ -53,7 +53,7 @@
%endif
Name: pipewire
Version: 0.3.46
Version: 0.3.47
Release: 0
Summary: A Multimedia Framework designed to be an audio and video server and more
License: MIT
@ -61,7 +61,12 @@ Group: Development/Libraries/C and C++
URL: https://pipewire.org/
Source0: %{name}-%{version}.tar.xz
Source99: baselibs.conf
# PATCH-FIX-OPENSUSE reduce-meson-dependency.patch
Patch0: reduce-meson-dependency.patch
# PATCH-FIX-UPSTREAM 0001-revert-loop-remove-destroy-list.patch
Patch1: 0001-revert-loop-remove-destroy-list.patch
# PATCH-FIX-UPSTREAM 0002-pulse-server-free-pending-sample-reply.patch
Patch2: 0002-pulse-server-free-pending-sample-reply.patch
BuildRequires: docutils
BuildRequires: doxygen
BuildRequires: fdupes
@ -339,7 +344,6 @@ export CXX=g++-9
-Ddocs=enabled \
-Dman=enabled \
-Dgstreamer=enabled \
-Dgstreamer-device-provider=disabled \
-Dffmpeg=enabled \
-Dsystemd=enabled \
-Dsystemd-user-unit-dir=%{_userunitdir} \

View File

@ -1,10 +1,10 @@
Index: pipewire-0.3.46/meson.build
Index: pipewire-0.3.47/meson.build
===================================================================
--- pipewire-0.3.46.orig/meson.build
+++ pipewire-0.3.46/meson.build
+++ pipewire-0.3.47/meson.build
@@ -1,7 +1,7 @@
project('pipewire', ['c' ],
version : '0.3.46',
version : '0.3.47',
license : [ 'MIT', 'LGPL-2.1-or-later', 'GPL-2.0-only' ],
- meson_version : '>= 0.59.0',
+ meson_version : '>= 0.54.0',
@ -110,10 +110,10 @@ Index: pipewire-0.3.46/meson.build
+if meson.version().version_compare('>=0.58.0')
+ meson.add_devenv(devenv)
+endif
Index: pipewire-0.3.46/spa/plugins/audioconvert/meson.build
Index: pipewire-0.3.47/spa/plugins/audioconvert/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/plugins/audioconvert/meson.build
+++ pipewire-0.3.46/spa/plugins/audioconvert/meson.build
+++ pipewire-0.3.47/spa/plugins/audioconvert/meson.build
@@ -140,7 +140,7 @@ foreach a : test_apps
install : installed_tests_enabled,
install_dir : installed_tests_execdir / 'audioconvert'),
@ -132,10 +132,10 @@ Index: pipewire-0.3.46/spa/plugins/audioconvert/meson.build
])
if installed_tests_enabled
Index: pipewire-0.3.46/spa/tests/meson.build
Index: pipewire-0.3.47/spa/tests/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/tests/meson.build
+++ pipewire-0.3.46/spa/tests/meson.build
+++ pipewire-0.3.47/spa/tests/meson.build
@@ -5,7 +5,7 @@ find = find_program('find', required: fa
summary({'find (for header testing)': find.found()}, bool_yn: true, section: 'Optional programs')
if find.found()
@ -154,10 +154,10 @@ Index: pipewire-0.3.46/spa/tests/meson.build
]
)
Index: pipewire-0.3.46/src/daemon/meson.build
Index: pipewire-0.3.47/src/daemon/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/daemon/meson.build
+++ pipewire-0.3.46/src/daemon/meson.build
+++ pipewire-0.3.47/src/daemon/meson.build
@@ -18,9 +18,9 @@ conf_config.set('pulse_comment', '#')
conf_config_uninstalled = conf_config
@ -179,20 +179,20 @@ Index: pipewire-0.3.46/src/daemon/meson.build
)
#desktop_file = i18n.merge_file(
Index: pipewire-0.3.46/src/daemon/systemd/user/meson.build
Index: pipewire-0.3.47/src/daemon/systemd/user/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/daemon/systemd/user/meson.build
+++ pipewire-0.3.46/src/daemon/systemd/user/meson.build
+++ pipewire-0.3.47/src/daemon/systemd/user/meson.build
@@ -1,4 +1,4 @@
-systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
+#systemd_user_services_dir = systemd.get_variable('systemduserunitdir', pkgconfig_define : [ 'prefix', prefix])
if get_option('systemd-user-unit-dir') != ''
systemd_user_services_dir = get_option('systemd-user-unit-dir')
endif
Index: pipewire-0.3.46/src/modules/meson.build
Index: pipewire-0.3.47/src/modules/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/modules/meson.build
+++ pipewire-0.3.46/src/modules/meson.build
+++ pipewire-0.3.47/src/modules/meson.build
@@ -362,9 +362,9 @@ test('pw-test-protocol-native',
install_dir : installed_tests_execdir,
),
@ -206,10 +206,10 @@ Index: pipewire-0.3.46/src/modules/meson.build
]
)
Index: pipewire-0.3.46/src/tests/meson.build
Index: pipewire-0.3.47/src/tests/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/tests/meson.build
+++ pipewire-0.3.46/src/tests/meson.build
+++ pipewire-0.3.47/src/tests/meson.build
@@ -13,9 +13,9 @@ foreach a : test_apps
install : installed_tests_enabled,
install_dir : installed_tests_execdir),
@ -223,10 +223,10 @@ Index: pipewire-0.3.46/src/tests/meson.build
])
if installed_tests_enabled
Index: pipewire-0.3.46/test/meson.build
Index: pipewire-0.3.47/test/meson.build
===================================================================
--- pipewire-0.3.46.orig/test/meson.build
+++ pipewire-0.3.46/test/meson.build
+++ pipewire-0.3.47/test/meson.build
@@ -14,8 +14,8 @@ pwtest_deps = [
]
@ -238,10 +238,10 @@ Index: pipewire-0.3.46/test/meson.build
]
pwtest_inc = [
Index: pipewire-0.3.46/doc/meson.build
Index: pipewire-0.3.47/doc/meson.build
===================================================================
--- pipewire-0.3.46.orig/doc/meson.build
+++ pipewire-0.3.46/doc/meson.build
+++ pipewire-0.3.47/doc/meson.build
@@ -1,8 +1,8 @@
doxyfile_conf = configuration_data()
doxyfile_conf.set('PACKAGE_NAME', meson.project_name())
@ -342,10 +342,10 @@ Index: pipewire-0.3.46/doc/meson.build
doxyfile = configure_file(input: 'Doxyfile.in',
output: 'Doxyfile',
Index: pipewire-0.3.46/spa/meson.build
Index: pipewire-0.3.47/spa/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/meson.build
+++ pipewire-0.3.46/spa/meson.build
+++ pipewire-0.3.47/spa/meson.build
@@ -31,7 +31,7 @@ pkgconfig.generate(filebase : 'lib@0@'.f
subdir('include')
@ -363,10 +363,10 @@ Index: pipewire-0.3.46/spa/meson.build
+if (get_option('examples').enabled() or get_option('examples').auto())
subdir('examples')
endif
Index: pipewire-0.3.46/man/meson.build
Index: pipewire-0.3.47/man/meson.build
===================================================================
--- pipewire-0.3.46.orig/man/meson.build
+++ pipewire-0.3.46/man/meson.build
+++ pipewire-0.3.47/man/meson.build
@@ -19,7 +19,7 @@ manpages = [
'pw-profiler.1.rst.in',
]
@ -376,10 +376,10 @@ Index: pipewire-0.3.46/man/meson.build
manpages += 'pw-jack.1.rst.in'
endif
Index: pipewire-0.3.46/src/meson.build
Index: pipewire-0.3.47/src/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/meson.build
+++ pipewire-0.3.46/src/meson.build
+++ pipewire-0.3.47/src/meson.build
@@ -3,10 +3,10 @@ subdir('pipewire')
subdir('daemon')
subdir('tools')
@ -393,10 +393,10 @@ Index: pipewire-0.3.46/src/meson.build
subdir('tests')
endif
Index: pipewire-0.3.46/spa/plugins/bluez5/meson.build
Index: pipewire-0.3.47/spa/plugins/bluez5/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/plugins/bluez5/meson.build
+++ pipewire-0.3.46/spa/plugins/bluez5/meson.build
+++ pipewire-0.3.47/spa/plugins/bluez5/meson.build
@@ -6,12 +6,12 @@ foreach dep: bluez5_deps
endforeach
@ -438,10 +438,10 @@ Index: pipewire-0.3.46/spa/plugins/bluez5/meson.build
bluez5_sources += ['backend-hsphfpd.c']
endif
Index: pipewire-0.3.46/spa/plugins/meson.build
Index: pipewire-0.3.47/spa/plugins/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/plugins/meson.build
+++ pipewire-0.3.46/spa/plugins/meson.build
+++ pipewire-0.3.47/spa/plugins/meson.build
@@ -1,16 +1,16 @@
if alsa_dep.found()
subdir('alsa')
@ -495,10 +495,10 @@ Index: pipewire-0.3.46/spa/plugins/meson.build
-subdir('aec')
\ No newline at end of file
+subdir('aec')
Index: pipewire-0.3.46/spa/plugins/support/meson.build
Index: pipewire-0.3.47/spa/plugins/support/meson.build
===================================================================
--- pipewire-0.3.46.orig/spa/plugins/support/meson.build
+++ pipewire-0.3.46/spa/plugins/support/meson.build
+++ pipewire-0.3.47/spa/plugins/support/meson.build
@@ -23,7 +23,7 @@ spa_support_lib = shared_library('spa-su
install_dir : spa_plugindir / 'support')
spa_support_dep = declare_dependency(link_with: spa_support_lib)
@ -508,10 +508,10 @@ Index: pipewire-0.3.46/spa/plugins/support/meson.build
evl_inc = include_directories('/usr/evl/include')
evl_lib = cc.find_library('evl',
dirs: ['/usr/evl/lib/'],
Index: pipewire-0.3.46/src/daemon/systemd/meson.build
Index: pipewire-0.3.47/src/daemon/systemd/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/daemon/systemd/meson.build
+++ pipewire-0.3.46/src/daemon/systemd/meson.build
+++ pipewire-0.3.47/src/daemon/systemd/meson.build
@@ -1,6 +1,6 @@
-if get_option('systemd-system-service').allowed()
+if (get_option('systemd-system-service').enabled() or get_option('systemd-system-service').auto())
@ -521,10 +521,10 @@ Index: pipewire-0.3.46/src/daemon/systemd/meson.build
+if (get_option('systemd-user-service').enabled() or get_option('systemd-user-service').auto())
subdir('user')
endif
Index: pipewire-0.3.46/src/gst/meson.build
Index: pipewire-0.3.47/src/gst/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/gst/meson.build
+++ pipewire-0.3.46/src/gst/meson.build
+++ pipewire-0.3.47/src/gst/meson.build
@@ -8,7 +8,7 @@ pipewire_gst_sources = [
'gstpipewiresrc.c',
]
@ -534,10 +534,10 @@ Index: pipewire-0.3.46/src/gst/meson.build
pipewire_gst_sources += [ 'gstpipewiredeviceprovider.c' ]
endif
Index: pipewire-0.3.46/src/tools/meson.build
Index: pipewire-0.3.47/src/tools/meson.build
===================================================================
--- pipewire-0.3.46.orig/src/tools/meson.build
+++ pipewire-0.3.46/src/tools/meson.build
+++ pipewire-0.3.47/src/tools/meson.build
@@ -34,7 +34,7 @@ if ncurses_dep.found()
endif