Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pipewire for openSUSE:Factory checked in at 2023-01-18 13:08:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pipewire (Old) and /work/SRC/openSUSE:Factory/.pipewire.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pipewire" Wed Jan 18 13:08:20 2023 rev:74 rq:1058859 version:0.3.64 Changes: -------- --- /work/SRC/openSUSE:Factory/pipewire/pipewire.changes 2023-01-14 20:31:44.973224134 +0100 +++ /work/SRC/openSUSE:Factory/.pipewire.new.32243/pipewire.changes 2023-01-18 13:08:24.695991179 +0100 @@ -1,0 +2,16 @@ +Tue Jan 17 08:28:49 UTC 2023 - Antonio Larrosa <alarr...@suse.com> + +- Add patch from upstream to avoid division by 0 and other issues + with invalid values (glfo#pipewire/pipewire#2953): + * 0001-alsa-guard-against-some-invalid-values.patch +- Add patch from upstream to fix causing an overflow resulting in + choppy sound in some cases (glfo#pipewire/pipewire#2680): + * 0001-spa-Fix-audioconvert-overflow-when-scaling.patch + +------------------------------------------------------------------- +Mon Jan 16 08:21:05 UTC 2023 - Antonio Larrosa <alarr...@suse.com> + +- Add patch from upstream to fix a crash on arm: + * 0001-cpu-arm-Fix-incorrect-free.patch + +------------------------------------------------------------------- @@ -24 +40 @@ - (#2914) + (glfo#pipewire/pipewire#2914) @@ -26 +42,2 @@ - suspended, were kept suspended on a rate change. (#2929) + suspended, were kept suspended on a rate change. + (glfo#pipewire/pipewire#2929) @@ -29 +46 @@ - rates were allowed. (#2925) + rates were allowed. (glfo#pipewire/pipewire#2925) @@ -44 +61 @@ - (#2891) + (glfo#pipewire/pipewire#2891) @@ -46 +63 @@ - properties. (#2933) + properties. (glfo#pipewire/pipewire#2933) @@ -50 +67 @@ - echo-cancel. (#2939) + echo-cancel. (glfo#pipewire/pipewire#2939) @@ -53 +70 @@ - (#1599) + (glfo#pipewire/pipewire#1599) @@ -62 +79,2 @@ - fail. This caused problems for espeak. (#2928) + fail. This caused problems for espeak. + (glfo#pipewire/pipewire#2928) @@ -68 +86 @@ - set to -1. (#2893) + set to -1. (glfo#pipewire/pipewire#2893) New: ---- 0001-alsa-guard-against-some-invalid-values.patch 0001-cpu-arm-Fix-incorrect-free.patch 0001-spa-Fix-audioconvert-overflow-when-scaling.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pipewire.spec ++++++ --- /var/tmp/diff_new_pack.LCBwrX/_old 2023-01-18 13:08:25.431995127 +0100 +++ /var/tmp/diff_new_pack.LCBwrX/_new 2023-01-18 13:08:25.439995170 +0100 @@ -64,6 +64,12 @@ Source99: baselibs.conf # PATCH-FIX-OPENSUSE reduce-meson-dependency.patch Patch0: reduce-meson-dependency.patch +# PATCH-FIX-UPSTREAM 0001-cpu-arm-Fix-incorrect-free.patch +Patch1: 0001-cpu-arm-Fix-incorrect-free.patch +# PATCH-FIX-UPSTREAM 0001-alsa-guard-against-some-invalid-values.patch +Patch2: 0001-alsa-guard-against-some-invalid-values.patch +# PATCH-FIX-UPSTREAM 0001-spa-Fix-audioconvert-overflow-when-scaling.patch +Patch3: 0001-spa-Fix-audioconvert-overflow-when-scaling.patch BuildRequires: docutils BuildRequires: doxygen @@ -356,6 +362,9 @@ %if 0%{?suse_version} <= 1500 && 0%{?sle_version} <= 150300 %patch0 -p1 %endif +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %if %{pkg_vcmp gcc < 8} ++++++ 0001-alsa-guard-against-some-invalid-values.patch ++++++ >From 32a7c85c84e419636109eb5db127292e25462a38 Mon Sep 17 00:00:00 2001 From: Wim Taymans <wtaym...@redhat.com> Date: Mon, 16 Jan 2023 16:05:17 +0100 Subject: [PATCH] alsa: guard against some invalid values Avoid division by 0 and other strange things when invalid values are detected. Fixes #2953 --- spa/plugins/alsa/alsa-pcm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 76fe433b8..08b9ceddd 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1519,6 +1519,11 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ fmt->info.raw.rate = rrate; match = false; } + if (rchannels == 0 || rrate == 0) { + spa_log_error(state->log, "%s: invalid channels:%d or rate:%d", + state->props.device, rchannels, rrate); + return -EIO; + } state->format = rformat; state->channels = rchannels; @@ -1563,6 +1568,11 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ CHECK(snd_pcm_hw_params_set_period_size_near(hndl, params, &period_size, &dir), "set_period_size_near"); + if (period_size == 0) { + spa_log_error(state->log, "%s: invalid period_size 0 (driver error?)", state->props.device); + return -EIO; + } + state->period_frames = period_size; if (state->default_period_num != 0) { @@ -1578,6 +1588,10 @@ int spa_alsa_set_format(struct state *state, struct spa_audio_info *fmt, uint32_ CHECK(snd_pcm_hw_params_set_buffer_size_near(hndl, params, &state->buffer_frames), "set_buffer_size_near"); periods = state->buffer_frames / period_size; } + if (state->buffer_frames == 0) { + spa_log_error(state->log, "%s: invalid buffer_frames 0 (driver error?)", state->props.device); + return -EIO; + } state->headroom = state->default_headroom; if (is_batch) @@ -2542,6 +2556,14 @@ int spa_alsa_start(struct state *state) state->duration = 1024; state->rate_denom = state->rate; } + if (state->rate_denom == 0) { + spa_log_error(state->log, "%s: unset rate_denom", state->props.device); + return -EIO; + } + if (state->duration == 0) { + spa_log_error(state->log, "%s: unset duration", state->props.device); + return -EIO; + } state->following = is_following(state); setup_matching(state); -- GitLab ++++++ 0001-cpu-arm-Fix-incorrect-free.patch ++++++ >From 65f3a9c481214ce015d20cee813dd9dac2de8dab Mon Sep 17 00:00:00 2001 From: Sanchayan Maity <sancha...@asymptotic.io> Date: Sat, 14 Jan 2023 15:14:29 +0530 Subject: [PATCH] cpu-arm: Fix incorrect free A bug was introduced with the refactoring in da26563. In arm_init, the buffer passed to spa_cpu_read_file is allocated and it is just going to return that. So cpuinfo will actually point to buffer on the stack, which need not be freed with a call to free. The crash resulting with the incorrect free. root@dragonboard-845c:~# pipewire --version munmap_chunk(): invalid pointer [ 185.037284] audit: type=1701 audit(1659949975.843:14): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=2243 comm="pipewire" exe="/usr/bin/pipewire" sig=6 res=1 Aborted root@dragonboard-845c:~# wireplumber --version munmap_chunk(): invalid pointer [ 193.453693] audit: type=1701 audit(1659949984.255:15): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=2244 comm="wireplumber" exe="/usr/bin/wireplumber" sig=6 res=1 Aborted Backtrace from the crash (gdb) bt !0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 !1 0x0000fffff7d8edd8 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78 !2 0x0000fffff7d4a390 in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.36-r0/sysdeps/posix/raise.c:26 !3 0x0000fffff7d37498 in __GI_abort () at abort.c:79 !4 0x0000fffff7d83374 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0xfffff7e5fc20 "%s\n") at /usr/src/debug/glibc/2.36-r0/sysdeps/posix/libc_fatal.c:155 !5 0x0000fffff7d988c0 in malloc_printerr (str=str@entry=0xfffff7e5a7f0 "munmap_chunk(): invalid pointer") at malloc.c:5660 !6 0x0000fffff7d98aac in munmap_chunk (p=p@entry=0xffffffffd258) at malloc.c:3054 !7 0x0000fffff7d9d068 in __GI___libc_free (mem=mem@entry=0xffffffffd268) at malloc.c:3375 !8 0x0000fffff7cd36cc in arm_init (impl=impl@entry=0xaaaaaaac8c48) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c:97 !9 0x0000fffff7cd391c in impl_init (factory=<optimized out>, handle=0xaaaaaaac8c48, info=0xffffffffe548, support=<optimized out>, n_support=<optimized out>) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu.c:264 !10 0x0000fffff7f3a234 in load_spa_handle (lib=<optimized out>, factory_name=factory_name@entry=0xfffff7f6d768 "support.cpu", info=info@entry=0xffffffffe548, n_support=1, support=support@entry=0xfffff7fb0488 <global_support+88>) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:280 !11 0x0000fffff7f3a5b0 in add_interface (factory_name=factory_name@entry=0xfffff7f6d768 "support.cpu", type=type@entry=0xfffff7f62310 "Spa:Pointer:Interface:CPU", info=info@entry=0xffffffffe548, support=0xfffff7fb0430 <global_support>) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:358 !12 0x0000fffff7f3b3f8 in pw_init (argc=argc@entry=0xffffffffea5c, argv=argv@entry=0xffffffffea50) at /usr/src/debug/pipewire/1.0-r0/src/pipewire/pipewire.c:661 !13 0x0000aaaaaaaa1104 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/pipewire/1.0-r0/src/daemon/pipewire.c:79 (gdb) f 8 !8 0x0000fffff7cd36cc in arm_init (impl=impl@entry=0xaaaaaaac8c48) at /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c:97 97 /usr/src/debug/pipewire/1.0-r0/spa/plugins/support/cpu-arm.c: No such file or directory. (gdb) info locals flags = 122 cpuinfo = 0xffffffffd268 "processor\t: 0\nBogoMIPS\t: 38.40\nFeatures\t: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop\nCPU implementer\t: 0x51\nCPU architecture: 8\nCPU variant\t. line = 0xaaaaaaac8ce0 "\310\252\252\252\n" buffer = "processor\t: 0\nBogoMIPS\t: 38.40\nFeatures\t: fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop\nCPU implementer\t: 0x51\nCPU architecture: 8\nCPU variant\t: 0x7\nCPU pa"... arch = <optimized out> __func__ = "arm_init" --- spa/plugins/support/cpu-arm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/spa/plugins/support/cpu-arm.c b/spa/plugins/support/cpu-arm.c index cfc54272c..6cd68d813 100644 --- a/spa/plugins/support/cpu-arm.c +++ b/spa/plugins/support/cpu-arm.c @@ -94,8 +94,6 @@ arm_init(struct impl *impl) free(line); } - free(cpuinfo); - impl->flags = flags; return 0; -- GitLab ++++++ 0001-spa-Fix-audioconvert-overflow-when-scaling.patch ++++++ >From 1d9640af5a7906620f214aa0a39c63128c8506a6 Mon Sep 17 00:00:00 2001 From: Wim Taymans <wtaym...@redhat.com> Date: Mon, 16 Jan 2023 18:28:31 +0100 Subject: [PATCH] spa: Fix audioconvert overflow when scaling Add SPA_SCALE32_UP that scales a uint32 without overflow. Use this for scaling the threshold in ALSA. Fix the scaling in audioconvert of the buffer size, the scaling was wrong and it was also causing an overflow resulting in choppy sound in some cases. See #2680 --- spa/include/spa/utils/defs.h | 8 ++++++++ spa/plugins/alsa/alsa-pcm.c | 4 ++-- spa/plugins/audioconvert/audioconvert.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index c602c9348..3b4862663 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -274,6 +274,14 @@ struct spa_fraction { #define SPA_ROUND_DOWN_N(num,align) ((num) & ~SPA_ROUND_MASK(num, align)) #define SPA_ROUND_UP_N(num,align) ((((num)-1) | SPA_ROUND_MASK(num, align))+1) +#define SPA_SCALE32_UP(val,num,denom) \ +({ \ + uint64_t _val = (val); \ + uint64_t _denom = (denom); \ + (uint32_t)(((_val) * (num) + (_denom)-1) / (_denom)); \ +}) + + #define SPA_PTR_ALIGNMENT(p,align) ((intptr_t)(p) & ((align)-1)) #define SPA_IS_ALIGNED(p,align) (SPA_PTR_ALIGNMENT(p,align) == 0) #define SPA_PTR_ALIGN(p,align,type) ((type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align))) diff --git a/spa/plugins/alsa/alsa-pcm.c b/spa/plugins/alsa/alsa-pcm.c index 08b9ceddd..012b46031 100644 --- a/spa/plugins/alsa/alsa-pcm.c +++ b/spa/plugins/alsa/alsa-pcm.c @@ -1999,7 +1999,7 @@ static inline void check_position_config(struct state *state) (state->rate_denom != state->position->clock.rate.denom))) { state->duration = state->position->clock.duration; state->rate_denom = state->position->clock.rate.denom; - state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom; + state->threshold = SPA_SCALE32_UP(state->duration, state->rate, state->rate_denom); state->max_error = SPA_MAX(256.0f, state->threshold / 2.0f); state->resample = ((uint32_t)state->rate != state->rate_denom) || state->matching; state->alsa_sync = true; @@ -2569,7 +2569,7 @@ int spa_alsa_start(struct state *state) setup_matching(state); spa_dll_init(&state->dll); - state->threshold = (state->duration * state->rate + state->rate_denom-1) / state->rate_denom; + state->threshold = SPA_SCALE32_UP(state->duration, state->rate, state->rate_denom); state->last_threshold = state->threshold; state->max_error = SPA_MAX(256.0f, state->threshold / 2.0f); diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index 578f70ff9..783ab8174 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -1755,7 +1755,7 @@ impl_node_port_enum_params(void *object, int seq, size = this->quantum_limit * 2; /* scale the buffer size when we can. */ if (irate != 0 && orate != 0) - size = size * (irate + orate - 1) / orate; + size = SPA_SCALE32_UP(size, irate, orate); } param = spa_pod_builder_add_object(&b, -- GitLab