aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlabel
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-09-11 01:39:43 -0400
committerEric W. Biederman <ebiederm@xmission.com>2012-09-17 21:08:54 -0400
commite1760bd5ffae8cb98cffb030ee8e631eba28f3d8 (patch)
tree4694a60b407c418bf7de4b97355dc3bd0e6c6559 /net/netlabel
parentca57ec0f00c3f139c41bf6b0a5b9bcc95bbb2ad7 (diff)
userns: Convert the audit loginuid to be a kuid
Always store audit loginuids in type kuid_t. Print loginuids by converting them into uids in the appropriate user namespace, and then printing the resulting uid. Modify audit_get_loginuid to return a kuid_t. Modify audit_set_loginuid to take a kuid_t. Modify /proc/<pid>/loginuid on read to convert the loginuid into the user namespace of the opener of the file. Modify /proc/<pid>/loginud on write to convert the loginuid rom the user namespace of the opener of the file. Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Eric Paris <eparis@redhat.com> Cc: Paul Moore <paul@paul-moore.com> ? Cc: David Miller <davem@davemloft.net> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net/netlabel')
-rw-r--r--net/netlabel/netlabel_unlabeled.c2
-rw-r--r--net/netlabel/netlabel_user.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c
index e7ff694f1049..729a345c75a4 100644
--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -1541,7 +1541,7 @@ int __init netlbl_unlabel_defconf(void)
1541 * it is called is at bootup before the audit subsystem is reporting 1541 * it is called is at bootup before the audit subsystem is reporting
1542 * messages so don't worry to much about these values. */ 1542 * messages so don't worry to much about these values. */
1543 security_task_getsecid(current, &audit_info.secid); 1543 security_task_getsecid(current, &audit_info.secid);
1544 audit_info.loginuid = 0; 1544 audit_info.loginuid = GLOBAL_ROOT_UID;
1545 audit_info.sessionid = 0; 1545 audit_info.sessionid = 0;
1546 1546
1547 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 1547 entry = kzalloc(sizeof(*entry), GFP_KERNEL);
diff --git a/net/netlabel/netlabel_user.c b/net/netlabel/netlabel_user.c
index 9fae63f10298..9650c4ad5f88 100644
--- a/net/netlabel/netlabel_user.c
+++ b/net/netlabel/netlabel_user.c
@@ -109,7 +109,7 @@ struct audit_buffer *netlbl_audit_start_common(int type,
109 return NULL; 109 return NULL;
110 110
111 audit_log_format(audit_buf, "netlabel: auid=%u ses=%u", 111 audit_log_format(audit_buf, "netlabel: auid=%u ses=%u",
112 audit_info->loginuid, 112 from_kuid(&init_user_ns, audit_info->loginuid),
113 audit_info->sessionid); 113 audit_info->sessionid);
114 114
115 if (audit_info->secid != 0 && 115 if (audit_info->secid != 0 &&