Linux bluetooth development
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com>,
	 linux-bluetooth@vger.kernel.org
Cc: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: Re: [PATCH BlueZ 0/1] mpris-proxy: Fix possible crash on OBEX transfer
Date: Wed, 25 Nov 2026 10:20:59 +0100	[thread overview]
Message-ID: <6b7836f674530e930c8fc7431a50b5d2eec017f4.camel@hadess.net> (raw)
In-Reply-To: <20261106080515.2296-1-kaichuan.hsieh@canonical.com>

On Fri, 2026-11-06 at 08:05 +0000, Kai-Chuan Hsieh wrote:
> This fixes a mpris-proxy crash (NULL dereference) that triggers on
> every
> OBEX transfer, most visibly when a remote peer pushes a file to the
> host
> over Bluetooth OBEX Object Push.
> 
> find_player_by_obex() is called from obex_property_changed() on every
> Status change of any org.bluez.obex.Transfer1 object. Since the OBEX
> g_dbus_client_new() client is rooted at "/", mpris-proxy proxies all
> of
> obexd's objects, including the server-side transfer objects obexd
> registers for an incoming push. Those never belong to a player, so
> the
> list walk dereferences a NULL player->obex / session->obex and
> crashes.
> A second, narrower crash exists in obex_get_image() when a failed
> CreateSession leaves the inner proxy NULL and a Track change carries
> an
> ImgHandle.
> 
> The affected code path (BIP cover art / find_player_by_obex) was
> introduced between 5.77 and 5.80 and is still present in 5.88/master.

Regression fixes are usually annotated with:
Fixes: <sha> ("commit subject")
in the commit message.

See:
https://www.kernel.org/doc/html/v7.0/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

This makes it easier to spot mandatory fixes and when bugs were
introduced.

> 
> This change consolidates two earlier fixes that were proposed but
> never
> merged, because the project moved off GitHub pull requests:
> 
>   - PR #2098 (Bastien Nocera, "mpris-proxy: Fix possible crash"),
>     https://github.com/bluez/bluez/pull/2098 -- passed CI, auto-
> closed.
>   - issue #2569 / PR #2631, the additional inner-proxy (session-
> >obex)
>     guard for the failed-CreateSession case,
>     https://github.com/bluez/bluez/issues/2569
>     https://github.com/bluez/bluez/pull/2631
> 
> Resending here on linux-bluetooth so it can land for the next
> release.

I'm not super-happy with the way this was all merged together.

My original fixes had 2 separate patches, which I think should still be
sent and applied separately. That would make it easier to see your
actual contribution.

As a matter of etiquette, it's usually fine re-sending people's patches
if the patches lapsed, or even making them better and adding yourself
as a "Co-Authored-by:" if the contribution was significant.

In this case, it looks like my 2 patches should be re-sent, and a 3 one
added to the set, is that correct?

I've also mentioned on https://github.com/bluez/bluez/issues/2569 that
I think the crash should be added to our own regression tests. I don't
know whether there's a good place for those right now.

Regards

> The change is confined to tools/mpris-proxy.c and only adds NULL /
> early-
> return guards before existing dereferences, plus a g_clear_pointer()
> when releasing session->obex; it adds no new dereferences.
> 
> Downstream bug report (reproducer and SRU analysis):
> https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/2172906
> 
> 
> Kai-Chuan Hsieh (1):
>   mpris-proxy: Fix possible crash on OBEX transfer
> 
>  tools/mpris-proxy.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)

  parent reply	other threads:[~2026-11-25  9:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06  8:05 [PATCH BlueZ 0/1] mpris-proxy: Fix possible crash on OBEX transfer Kai-Chuan Hsieh
2026-11-06  8:05 ` [PATCH BlueZ 1/1] " Kai-Chuan Hsieh
2026-11-06 10:47   ` bluez.test.bot
2026-11-21 10:19   ` bluez.test.bot
2026-11-25  9:20 ` Bastien Nocera [this message]
2026-11-26  6:47   ` [PATCH BlueZ v2 0/3] " Kai-Chuan Hsieh
2026-11-26  6:47   ` [PATCH BlueZ v2 1/3] mpris-proxy: Fix possible crash Kai-Chuan Hsieh
2026-11-26 14:54     ` [BlueZ,v2,1/3] " bluez.test.bot
2026-11-26  6:47   ` [PATCH BlueZ v2 2/3] mpris-proxy: Avoid session->obex dereference Kai-Chuan Hsieh
2026-11-26  6:47   ` [PATCH BlueZ v2 3/3] mpris-proxy: Check OBEX session proxy before use Kai-Chuan Hsieh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b7836f674530e930c8fc7431a50b5d2eec017f4.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=kaichuan.hsieh@canonical.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox