summaryrefslogtreecommitdiff
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2013-03-19 00:02:25 -0700
committerEric Paris <eparis@redhat.com>2014-01-13 22:26:48 -0500
commitca24a23ebca17d9d0f2afde4ee49cd810bccc8d7 (patch)
tree9049f1e4911b21c181b3dcb435b5c75c8e18142c /kernel/auditsc.c
parentfc582aef7dcc27a7120cf232c1e76c569c7b6eab (diff)
downloadlinux-sh-ca24a23ebca17d9d0f2afde4ee49cd810bccc8d7.tar.gz
audit: Simplify and correct audit_log_capset
- Always report the current process as capset now always only works on the current process. This prevents reporting 0 or a random pid in a random pid namespace. - Don't bother to pass the pid as is available. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> (cherry picked from commit bcc85f0af31af123e32858069eb2ad8f39f90e67) (cherry picked from commit f911cac4556a7a23e0b3ea850233d13b32328692) Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [eparis: fix build error when audit disabled] Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 90594c9f7552..df1e685809e1 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -2321,18 +2321,16 @@ int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
/**
* __audit_log_capset - store information about the arguments to the capset syscall
- * @pid: target pid of the capset call
* @new: the new credentials
* @old: the old (current) credentials
*
* Record the aguments userspace sent to sys_capset for later printing by the
* audit system if applicable
*/
-void __audit_log_capset(pid_t pid,
- const struct cred *new, const struct cred *old)
+void __audit_log_capset(const struct cred *new, const struct cred *old)
{
struct audit_context *context = current->audit_context;
- context->capset.pid = pid;
+ context->capset.pid = task_pid_nr(current);
context->capset.cap.effective = new->cap_effective;
context->capset.cap.inheritable = new->cap_effective;
context->capset.cap.permitted = new->cap_permitted;