diff options
author | David Howells <dhowells@redhat.com> | 2008-11-13 18:39:12 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-11-13 18:39:12 -0500 |
commit | 76aac0e9a17742e60d408be1a706e9aaad370891 (patch) | |
tree | e873a000d9c96209726e0958e311f005c13b2ed5 /kernel/auditsc.c | |
parent | b103c59883f1ec6e4d548b25054608cb5724453c (diff) |
CRED: Wrap task credential accesses in the core kernel
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.
Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-audit@redhat.com
Cc: containers@lists.linux-foundation.org
Cc: linux-mm@kvack.org
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index cef34235b362..9c7e47ae4576 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -2628,7 +2628,8 @@ void audit_core_dumps(long signr) | |||
2628 | { | 2628 | { |
2629 | struct audit_buffer *ab; | 2629 | struct audit_buffer *ab; |
2630 | u32 sid; | 2630 | u32 sid; |
2631 | uid_t auid = audit_get_loginuid(current); | 2631 | uid_t auid = audit_get_loginuid(current), uid; |
2632 | gid_t gid; | ||
2632 | unsigned int sessionid = audit_get_sessionid(current); | 2633 | unsigned int sessionid = audit_get_sessionid(current); |
2633 | 2634 | ||
2634 | if (!audit_enabled) | 2635 | if (!audit_enabled) |
@@ -2638,8 +2639,9 @@ void audit_core_dumps(long signr) | |||
2638 | return; | 2639 | return; |
2639 | 2640 | ||
2640 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); | 2641 | ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); |
2642 | current_uid_gid(&uid, &gid); | ||
2641 | audit_log_format(ab, "auid=%u uid=%u gid=%u ses=%u", | 2643 | audit_log_format(ab, "auid=%u uid=%u gid=%u ses=%u", |
2642 | auid, current->uid, current->gid, sessionid); | 2644 | auid, uid, gid, sessionid); |
2643 | security_task_getsecid(current, &sid); | 2645 | security_task_getsecid(current, &sid); |
2644 | if (sid) { | 2646 | if (sid) { |
2645 | char *ctx = NULL; | 2647 | char *ctx = NULL; |