Merge lp://qastaging/~thomas-voss/location-service/fix-1219164 into lp://qastaging/location-service/trunk

Proposed by Thomas Voß
Status: Merged
Approved by: Thomas Voß
Approved revision: 90
Merged at revision: 82
Proposed branch: lp://qastaging/~thomas-voss/location-service/fix-1219164
Merge into: lp://qastaging/location-service/trunk
Diff against target: 1037 lines (+616/-37)
20 files modified
CMakeLists.txt (+7/-1)
data/CMakeLists.txt (+9/-0)
data/com.ubuntu.location.Service.conf (+5/-1)
data/ubuntu-location-service-trust-stored.conf.in (+13/-0)
debian/control (+4/-0)
debian/ubuntu-location-service-bin.install (+1/-0)
examples/service/service.cpp (+1/-1)
include/location_service/com/ubuntu/location/service/interface.h (+1/-1)
src/location_service/com/ubuntu/location/CMakeLists.txt (+7/-0)
src/location_service/com/ubuntu/location/service/config.h.in (+38/-0)
src/location_service/com/ubuntu/location/service/daemon.cpp (+11/-2)
src/location_service/com/ubuntu/location/service/default_configuration.cpp (+3/-10)
src/location_service/com/ubuntu/location/service/default_configuration.h (+18/-13)
src/location_service/com/ubuntu/location/service/session/skeleton.cpp (+3/-3)
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.cpp (+176/-0)
src/location_service/com/ubuntu/location/service/trust_store_permission_manager.h (+85/-0)
tests/CMakeLists.txt (+1/-0)
tests/acceptance_tests.cpp (+26/-5)
tests/app_armor_testing_profile (+3/-0)
tests/trust_store_permission_manager_test.cpp (+204/-0)
To merge this branch: bzr merge lp://qastaging/~thomas-voss/location-service/fix-1219164
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Seth Arnold (community) Approve
Jamie Strandboge Pending
Marc Deslauriers Pending
Manuel de la Peña Pending
Review via email: mp+228861@code.qastaging.launchpad.net

Commit message

Make the location service a trusted helper.

Description of the change

Make the location-service a trusted helper.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
75. By Thomas Voß

Add missing build dependencies.
Add tests for TrustStorePermissionManager.
Add tests for AppArmorProfileResolver together with testing apparmor profiles.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
76. By Thomas Voß

[ thomas-voss ]
* Make sure that logging directories are created on service startup.
  (LP: #1349704)
* Fix build warnings.
* Add a vanilla gps.conf file and install it to /etc/gps.conf. Make
  sure that expections thrown while trying to download GPS Xtra data
  do not abort the service. (LP: #1347887)
[ Pete Woods ]
* Add libdbus-cpp and libdbus as dependencies on devel package.
* Enable building on arm64, powerpc and ppc64el.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
77. By Thomas Voß

Make sure that acceptance tests do not fail due to missing trust.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
78. By Thomas Voß

Make sure that upstart configuration for trust-stored is shipped with -bin package.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
79. By Thomas Voß

42 as a pid really does not work well, use getpid() instead.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
80. By Thomas Voß

Execute the incoming connection on a pool of 3 threads.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
81. By Thomas Voß

Adjust dispatching policy for service implementation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
82. By Thomas Voß

Wait at most 60 seconds for creating a session with the location service.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
83. By Thomas Voß

Dispatch updates from providers instead of calling directly into the client.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
84. By Thomas Voß

Revert dispatcher changes.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
85. By Thomas Voß

Adjust timeout for session creation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Seth Arnold (seth-arnold) wrote :

The AppArmor policies are being looked up by pid which can be a racy interface. Do the races matter to us? Will something else in the system prevent the following chain of events?

A process with pid 4242 running with AppArmor profile Foo makes a location request
A process dies from some event
B process with any pid spawns children until one has pid 4242
C process with pid 4242 running with AppArmor profile Bar receives permission to use location from previous request

It seems fairly unlikely, I'll admit, but if an attacker can chew up enough CPU time, some race conditions can become arbitrarily easy to exploit.

Thanks

review: Needs Information
86. By Thomas Voß

Asynchronously deliver position/heading/velocity updates.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
87. By Thomas Voß

Add trust-store-bin as build- and runtime-dependency.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
88. By Thomas Voß

Finishing touches to the user-session upstart job for starting the trust-stored skeleton.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
89. By Thomas Voß

Adjust description strings.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Thomas Voß (thomas-voss) wrote :

> The AppArmor policies are being looked up by pid which can be a racy
> interface. Do the races matter to us? Will something else in the system
> prevent the following chain of events?
>
> A process with pid 4242 running with AppArmor profile Foo makes a location
> request
> A process dies from some event
> B process with any pid spawns children until one has pid 4242
> C process with pid 4242 running with AppArmor profile Bar receives permission
> to use location from previous request
>
> It seems fairly unlikely, I'll admit, but if an attacker can chew up enough
> CPU time, some race conditions can become arbitrarily easy to exploit.
>

It's a very good point. To address it, I would propose:

  (1.) Query pid*, uid*, apparmor* profile from dbus daemon
  (2.) Query agent
  (3.) Query pid, uid, apparmor and compare to pid*, uid*, apparmor*

Issue and task is captured here: https://bugs.launchpad.net/location-service/+bug/1352978. However, I would think that we should land the MP as is to make sure we have fixed the critical RTM bug.
> Thanks

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Addressing the potential race in an update is fine with me, thanks for already filing the bug.

We may wish to reconsider the "<profile> is trying to access your location" string -- while this is nicely unambiguous, it's also going to be incomprehensible for the average user.

Are there human-legible strings that uniquely identify the application? Say, APP_ID and a publisher id?

review: Approve
90. By Thomas Voß

We really should store the app id, not the service name.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches