]> Pileus Git - ~andy/linux/commitdiff
LSM: remove the task field from common_audit_data
authorEric Paris <eparis@redhat.com>
Wed, 4 Apr 2012 19:01:43 +0000 (15:01 -0400)
committerEric Paris <eparis@redhat.com>
Mon, 9 Apr 2012 16:23:03 +0000 (12:23 -0400)
There are no legitimate users.  Always use current and get back some stack
space for the common_audit_data.

Signed-off-by: Eric Paris <eparis@redhat.com>
include/linux/lsm_audit.h
security/lsm_audit.c
security/selinux/hooks.c

index 9e1ebf5851b87020cd3cdcab7ebd13423778efcb..75368c1aac78dc567358a759dfafc57711ff2bed 100644 (file)
@@ -53,7 +53,6 @@ struct common_audit_data {
 #define LSM_AUDIT_DATA_KMOD    8
 #define LSM_AUDIT_DATA_INODE   9
 #define LSM_AUDIT_DATA_DENTRY  10
-       struct task_struct *tsk;
        union   {
                struct path path;
                struct dentry *dentry;
index 90c129b0102f5cbe43129695bde3c3b924b84987..e796d2517653a262d8f37992558ed1218d17cbee 100644 (file)
@@ -213,12 +213,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
 {
        struct task_struct *tsk = current;
 
-       if (a->tsk)
-               tsk = a->tsk;
-       if (tsk && tsk->pid) {
-               audit_log_format(ab, " pid=%d comm=", tsk->pid);
-               audit_log_untrustedstring(ab, tsk->comm);
-       }
+       audit_log_format(ab, " pid=%d comm=", tsk->pid);
+       audit_log_untrustedstring(ab, tsk->comm);
 
        switch (a->type) {
        case LSM_AUDIT_DATA_NONE:
index 9f03844930093921dee796bc3fd3ac232679f1c9..d79762946c6e968177dcf8752861ff1d1120682c 100644 (file)
@@ -1429,7 +1429,6 @@ static int cred_has_capability(const struct cred *cred,
 
        COMMON_AUDIT_DATA_INIT(&ad, LSM_AUDIT_DATA_CAP);
        ad.selinux_audit_data = &sad;
-       ad.tsk = current;
        ad.u.cap = cap;
 
        switch (CAP_TO_INDEX(cap)) {