From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] control: Fix invalid access
Date: Fri, 24 Nov 2017 11:12:12 +0200 [thread overview]
Message-ID: <CABBYNZKuAnKDMLc3C2QqZVm8kac9bBYOvLtNajRS9MiZR+20yg@mail.gmail.com> (raw)
In-Reply-To: <20171123130145.10480-1-luiz.dentz@gmail.com>
Hi,
On Thu, Nov 23, 2017 at 3:01 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> When both controller and target roles are supported by a device they
> would share the same btd_service user_data pointer which would lead to
> use after free once either service is removed.
> ---
> profiles/audio/control.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/profiles/audio/control.c b/profiles/audio/control.c
> index 707276d29..4ab1f9b0f 100644
> --- a/profiles/audio/control.c
> +++ b/profiles/audio/control.c
> @@ -275,11 +275,15 @@ static void path_unregister(void *data)
>
> avctp_remove_state_cb(control->avctp_id);
>
> - if (control->target)
> + if (control->target) {
> + btd_service_set_user_data(control->target, NULL);
> btd_service_unref(control->target);
> + }
>
> - if (control->remote)
> + if (control->remote) {
> + btd_service_set_user_data(control->remote, NULL);
> btd_service_unref(control->remote);
> + }
>
> devices = g_slist_remove(devices, control);
> g_free(control);
> --
> 2.13.6
Applied.
--
Luiz Augusto von Dentz
next prev parent reply other threads:[~2017-11-24 9:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-23 13:01 [PATCH BlueZ] control: Fix invalid access Luiz Augusto von Dentz
2017-11-24 9:12 ` Luiz Augusto von Dentz [this message]
2017-11-24 17:56 ` Bastien Nocera
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=CABBYNZKuAnKDMLc3C2QqZVm8kac9bBYOvLtNajRS9MiZR+20yg@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).