Repository navigation
Conversation
PipeWire 1.5.84 and later can drop a stream's active port while BlueZ switches a headset profile. gvc_mixer_stream_get_port() now returns NULL in that case, but three callers still dereference the result. That turns the old g_assert_not_reached abort into a NULL pointer dereference in cinnamon and csd-media-keys when a Bluetooth headset connects. Reproduced on Ubuntu 26.04 with PipeWire 1.6.2: segfault at 0 in libcvc.so.0. Issue linuxmint#267 removed the assert. These call sites were left unchecked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PipeWire 1.5.84+ can change a stream's port list while BlueZ switches a Bluetooth headset profile (
pipewire#5053).gvc_mixer_stream_get_port()was updated to return NULL when the active port is gone (the libgnome-volume-control change that closed #267), but three callers still dereference that pointer:gvc_mixer_control_lookup_device_from_streamgvc_mixer_control_change_outputgvc_mixer_control_change_inputgvc_mixer_control_update_sinkandupdate_sourcealready test for NULL. These three do not, so the oldg_assert_not_reached()abort becomes a NULL dereference.How to reproduce
Both
cinnamonandcsd-media-keysdie at the same time:On 6.4.2, before the assert was removed, the same event aborts instead:
The desktop then tries to fall back to Metacity (
cinnamon-launcher), which is not installed on Ubuntu, so the session looks like X died.Fix
Treat a missing active port like a port change: skip the lookup when
portis NULL, and callgvc_mixer_stream_change_port()whenactive_portis NULL.Verified locally: three Bluetooth disconnect/connect cycles after the check, same
cinnamonPID, no new segfault.Fixes the remaining crash from #267.