All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: Sonny Sasaka <sonnysasaka@chromium.org>, linux-bluetooth@vger.kernel.org
Cc: Miao-chen Chou <mcchou@chromium.org>
Subject: Re: [PATCH BlueZ v2 7/7] battery: Implement Battery Provider API
Date: Tue, 17 Nov 2020 11:51:34 +0100	[thread overview]
Message-ID: <aa1c080e8a7813299e6a093608211684e074e427.camel@hadess.net> (raw)
In-Reply-To: <20201111011745.2016-7-sonnysasaka@chromium.org>

Hey Sonny,

On Tue, 2020-11-10 at 17:17 -0800, Sonny Sasaka wrote:
> This patch implements the BatteryProvider1 and
> BatteryProviderManager1
> API. This is a means for external clients to feed battery information
> to
> BlueZ if they handle some profile and can decode battery reporting.
> 
> The battery information is then exposed externally via the existing
> Battery1 interface. UI components can consume this API to display
> Bluetooth peripherals' battery via a unified BlueZ API.

Was this patch reviewed for potential security problems? From the top
of my head, the possible problems would be:
- I don't see any filters on which user could register battery
providers, so on a multi user system, you could have a user logged in
via SSH squatting all the battery providers, while the user "at the
console" can't have their own providers. Also, what happens if the user
at the console changes (fast user switching)?
- It looks like battery providers don't check for paired, trusted or
even connected devices, so I would be able to create nearly unbound
number of battery providers depending on how big the cache for "seen"
devices is.

Given that the interface between upower and bluez is supposedly
trusted, it might be good to ensure that there are no fuzzing problems
on the bluez API side that could translate to causing problems in
upower itself.

I didn't review the code in depth, but, having written this mechanism
for Bluetooth battery reporting, I think that this is the right way to
go to allow daemons like pulseaudio to report battery status.

Cheers


  reply	other threads:[~2020-11-17 10:59 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  1:17 [PATCH BlueZ v2 1/7] battery: Add the internal Battery API Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 2/7] profiles/battery: Refactor to use battery library Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 3/7] battery: Add Source property to Battery API Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 4/7] doc: Add Battery Provider API doc Sonny Sasaka
2020-11-17  0:16   ` Luiz Augusto von Dentz
2020-11-17 22:37     ` Sonny Sasaka
2020-11-17 23:01       ` Luiz Augusto von Dentz
2020-11-17 23:16         ` Sonny Sasaka
2020-11-17 23:33           ` Luiz Augusto von Dentz
2020-11-17 23:55             ` Sonny Sasaka
2020-11-20 21:00               ` Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 5/7] test: Add test app for Battery Provider API Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 6/7] adapter: Add a public function to find a device by path Sonny Sasaka
2020-11-11  1:17 ` [PATCH BlueZ v2 7/7] battery: Implement Battery Provider API Sonny Sasaka
2020-11-17 10:51   ` Bastien Nocera [this message]
2020-11-17 18:01     ` Bastien Nocera
2020-11-17 22:22       ` Sonny Sasaka
2020-11-17 22:26         ` Sonny Sasaka
2020-11-19 10:53         ` Bastien Nocera
2020-11-19 20:25           ` Sonny Sasaka
2020-11-17 22:16     ` Sonny Sasaka
2020-11-17 22:26       ` Luiz Augusto von Dentz
2020-11-19 20:15         ` Sonny Sasaka
2020-11-19 23:56           ` Luiz Augusto von Dentz
2020-11-20 20:33             ` Sonny Sasaka
2020-11-19 10:44       ` Bastien Nocera
2020-11-19 20:20         ` Sonny Sasaka
2020-11-20 10:33           ` Bastien Nocera
2020-11-20 19:41             ` Sonny Sasaka
2020-11-11  1:28 ` [BlueZ,v2,1/7] battery: Add the internal Battery API bluez.test.bot

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=aa1c080e8a7813299e6a093608211684e074e427.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=mcchou@chromium.org \
    --cc=sonnysasaka@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.