Mediation of processes that acquire well-known names
authorJohn Johansen <john.johansen@canonical.com>
Thu, 13 Feb 2014 18:55:52 +0000 (12:55 -0600)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 18 Feb 2015 17:28:42 +0000 (17:28 +0000)
commitc2686d53f3065dc9443bb2744f3fbe50992962ea
tree2d0facedd2504695e661cf973fa684c453bd8a8d
parentcd23a5df10b0465c99f91b5f9c4e160480078c1a
Mediation of processes that acquire well-known names

When an AppArmor confined process wants to acquire a well-known name, a
check is performed to see if the action should be allowed.

The check is based on the connection's label, the bus type, and the name
being requested.

An example AppArmor rule that would allow the name
"com.example.ExampleName" to be acquired on the system bus would be:

  dbus bind bus=system name=com.example.ExampleName,

To let a process acquire any name on any bus, the rule would be:

  dbus bind,

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=75113
Signed-off-by: John Johansen <john.johansen@canonical.com>
[tyhicks: Use BusAppArmorConfinement, bug fixes, cleanup, commit msg]
[tyhicks: initialize reserved area at the start of the query string]
[tyhicks: Use empty string for NULL bustypes when building queries]
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/apparmor.c
bus/apparmor.h
bus/connection.c
bus/connection.h
bus/services.c