Allow ubuntu-system-settings to set a device's firmware
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | lxc-android-config (Ubuntu) |
High
|
Alfonso Sanchez-Beato | ||
Bug Description
Background:
To do Wi-Fi hotspots on krillin, we need to poke wifi by doing a call to wpa_supplicant's (undocumented/
Rationale:
Ubuntu System Settings needs to do the same things as aforementioned script, but via dbus [2], as phablet/current non-privileged user and unconfined.
What happens:
If phablet runs [2], this error message [3] is produced, which I interpret to be equivalent with "you're not welcome here".
What should happen instead:
Ubuntu System Settings should be able to make the call to wpa.
[1] http://
[2] gdbus call --system -d fi.w1.wpa_
[3] http://
Related branches
| description: | updated |
| no longer affects: | dbus (Ubuntu) |
| Jonas G. Drange (jonas-drange) wrote : | #1 |
| description: | updated |
| Jamie Strandboge (jdstrand) wrote : | #2 |
Jonas asked me to take a look at the security implications of this. Some observations:
* on touch, /var/lib/
* /usr/share/
* wpasupplicant (from the 'wpa' source package) ships /etc/dbus-
* wpasupplicant does not ship a policykit file and doesn't seem to have policykit support
* http://
* wpas_dbus_
Considering the current policy with NM and the phablet user on Touch, I think it is tolerable to give the phablet user the ability to use SetInterfaceFir
1. add policykit support to wpasupplicant, ship a policykit policy file that is very strict, then override on touch similar to how we do in /var/lib/
2. use a proxy service that runs as root on the system bus that can make this call on our behalf. This proxy service could be written from scratch, extend NetworkManager, use the connectivity-api, or something else
I think '2' is the path of least resistance. It probably makes sense to use something like connectivity-api and have it have methods like: SetAP(), SetSTA(), SetP2P(), each of which talks to wpasupplicant. I suggest talking to the connectivity-api folks for ideas on API and where to best put this.
| Changed in wpasupplicant (Ubuntu): | |
| status: | New → Invalid |
| summary: |
- Allow ubuntu-system-settings to set a device's firmware through - wpa_supplicant + Allow ubuntu-system-settings to set a device's firmware through the + private Connectivity API |
| description: | updated |
| Tony Espy (awe) wrote : Re: Allow ubuntu-system-settings to set a device's firmware through the private Connectivity API | #3 |
Thanks for the feedback Jamie!
A couple of comments in return...
1. NetworkManager polkit allows full access to sudo: I assume you meant that the decision was taken *before* we had proper polkit support on the phone?
2. urfkill polkit - allows active seat to call Block: The policy also allows BlockIdx ( ie. by index, whereas Block is by type ), and FlightMode by the active seat. How is this more permissive than needed? I'm not familiar enough with polkit to grok how this could be made more restrictive?
3. Regarding your proposed solution, why is polkit necessary when all non-system processes that run as 'phablet' are confined ( ie. can't make raw DBus calls anyways )?
4. Do you really think that adding polkit support to wpa_supplicant for a single DBus method is more work than creating a new proxy service? Also, I assume the proxy service would handle the polkit logic, and then fwd the call(s)?
-
| Jamie Strandboge (jdstrand) wrote : | #4 |
Yikes, sorry for just getting back to this now.
"1. NetworkManager polkit allows full access to sudo: I assume you meant that the decision was taken *before* we had proper polkit support on the phone?"
AFAIK, we don't have polkit prompting on the phone still. It doesn't really matter-- we don't want to go that route anyway because it is a poor user experience.
"2. urfkill polkit - allows active seat to call Block: The policy also allows BlockIdx ( ie. by index, whereas Block is by type ), and FlightMode by the active seat. How is this more permissive than needed? I'm not familiar enough with polkit to grok how this could be made more restrictive?"
I am not familiar with what Block and BlockIdx are supposed to do (which is why having someone more familiar like yourself comment is great :), but will trust your judgement that active seat is fine for these. FlightMode for active seat seems fine.
"3. Regarding your proposed solution, why is polkit necessary when all non-system processes that run as 'phablet' are confined ( ie. can't make raw DBus calls anyways )?"
It is true that click apps are confined and we have DBus mediation which will block access to wpasupplicant. Those aren't the problem. I'm concerned about the other things that run as the phablet user that are not click apps that are unconfined and providing security in depth. With polkit, we can make sure that just SetInterfaceFir
"4. Do you really think that adding polkit support to wpa_supplicant for a single DBus method is more work than creating a new proxy service? Also, I assume the proxy service would handle the polkit logic, and then fwd the call(s)?"
I was leaving the choice of what was easier up to you. We control connectivity-api but don't control wpasupplicant. My thinking was perhaps there are other hotspot related items that could be used in the proxy service instead of patches multiple sources and I was suggesting using the existing connectivity-api service to add a single API call for this. Eg, /com/ubuntu/
I'll leave whether to use connectivity-api for API design reasons up to you as an implementation detail.
| no longer affects: | indicator-network (Ubuntu) |
| summary: |
- Allow ubuntu-system-settings to set a device's firmware through the - private Connectivity API + Allow ubuntu-system-settings to set a device's firmware |
| description: | updated |
| Changed in wpasupplicant (Ubuntu): | |
| status: | Invalid → Confirmed |
Adding
<policy user="phablet">
</policy>
to /etc/dbus-
| Jamie Strandboge (jdstrand) wrote : | #6 |
From comment #2: "Considering the current policy with NM and the phablet user on Touch, I think it is tolerable to give the phablet user the ability to use SetInterfaceFir
That said, it is rather inflexible, is touch-specific and does not address when we have multiuser on devices-- policykit would handle that better because you can allow it to the active seat. You could do this, but this is likely going to have to be revisited within the next year.
| Tony Espy (awe) wrote : | #7 |
@Jamie
I asked Alfosno to prototype granting access with a DBus configuration change alone as proof-of-concept. Note, as the script we've been using for testing is a Python script, the "Introspectable" fragment was needed. As system settings is Qt-based, this may not be needed. We'll need Jonas to confirm.
As this approach works, I'm not sure whether or not the added polkit layer actually buys us much more security. As previously mentioned, all non-core click apps are confined, and cannot access DBus on their own. The only way an unconfined phablet processes could land on the phone ( besides our core apps ) is if a user enables developer-mode and installs the app via dpkg or directly via a binary installer, which means the extra polkit protection could easily be circumvented.
I think a developer would also discover pretty quickly that a new app was malicious if the WiFi hardware stopped working as a client, due to it's being put into hotspot mode.
| Changed in wpasupplicant (Ubuntu): | |
| importance: | Undecided → High |
| assignee: | nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato) |
| status: | Confirmed → In Progress |
| Jamie Strandboge (jdstrand) wrote : | #8 |
policykit doesn't give you much more over the bus policy as described here for a single user system, since the policykit configuration would also simply allow access to SetInterfaceFir
Like I said, this dbus bus policy is ok for now, but I have a strong suspicion it will need to be revisited for multiuser.
| affects: | wpasupplicant (Ubuntu) → lxc-android-config (Ubuntu) |
| Jonas G. Drange (jonas-drange) wrote : | #9 |
In silo 13.
| Launchpad Janitor (janitor) wrote : | #10 |
This bug was fixed in the package lxc-android-config - 0.226
---------------
lxc-android-config (0.226) wily; urgency=medium
[ Ricardo Salveti de Araujo ]
* etc/dbus-
SetInterfac
enable hotspot (LP: #1426923)
-- Ken VanDine <email address hidden> Wed, 10 Jun 2015 14:15:44 -0400
| Changed in lxc-android-config (Ubuntu): | |
| status: | In Progress → Fix Released |


I'm currently only succeeding with the following policy:
<policy user="jonas">
<allow send_destinatio n="fi.w1. wpa_supplicant1 "/>
<allow receive_ sender= "fi.w1. wpa_supplicant1 "/>
</policy>
Being more specific, e.g. adding interface and send_member, gives me errors that I should not get: Error: GDBus.Error: org.freedesktop .DBus.Error. InvalidArgs: Error return with empty body:
Do we have to blanket OK phablet's access to fi.w1.wpa_ supplicant1?