policy: make policy checks work across user namespaces
authorDjalal Harouni <tixxdz@opendz.org>
Mon, 8 Sep 2014 13:18:26 +0000 (14:18 +0100)
committerDaniel Mack <daniel@zonque.org>
Tue, 9 Sep 2014 08:35:04 +0000 (10:35 +0200)
commite09aeadfacd613b58d7b0c8562c477dbc1c8473c
treeae6fd72a50b4eca4f963133968cc1e194bb56c98
parentba8bc7bb7b845bf2a8707fe0b2b66aecb72dac3e
policy: make policy checks work across user namespaces

Use the global kuid_t and kgid_t to store uid/gid values, this way we
our policy checks will work across user namespaces.

Note that currently we ignore that the user is privileged in its own
namespaces and the policy access kuid_t and kgid_t were mapped into that
namespace. If this is requested we can add it later a la:
fs/inode.c:inode_owner_or_capable()

Add kdbus_policy_make_access() to convert the user provided info to the
current user namespace. Userspace struct is not changed, only the kernel
one.

This patch fixes test #8 of test-kdbus-policy

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
[daniel: group kdbus_policy_db_entry_access->{uid,gid} in a union]
policy.c