]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - security/integrity/integrity_audit.c
Merge git://git.infradead.org/users/eparis/audit
[karo-tx-linux.git] / security / integrity / integrity_audit.c
index 809ec8428ee7d46195997d1b9675a7c8e55f5694..90987d15b6fe6c01ca593e185d2ae7a780186c31 100644 (file)
@@ -7,7 +7,7 @@
  * the Free Software Foundation, version 2 of the License.
  *
  * File: integrity_audit.c
- *     Audit calls for the integrity subsystem
+ *     Audit calls for the integrity subsystem
  */
 
 #include <linux/fs.h>
@@ -33,13 +33,14 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
                         const char *cause, int result, int audit_info)
 {
        struct audit_buffer *ab;
+       char name[TASK_COMM_LEN];
 
        if (!integrity_audit_info && audit_info == 1)   /* Skip info messages */
                return;
 
        ab = audit_log_start(current->audit_context, GFP_KERNEL, audit_msgno);
        audit_log_format(ab, "pid=%d uid=%u auid=%u ses=%u",
-                        current->pid,
+                        task_pid_nr(current),
                         from_kuid(&init_user_ns, current_cred()->uid),
                         from_kuid(&init_user_ns, audit_get_loginuid(current)),
                         audit_get_sessionid(current));
@@ -49,7 +50,7 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
        audit_log_format(ab, " cause=");
        audit_log_string(ab, cause);
        audit_log_format(ab, " comm=");
-       audit_log_untrustedstring(ab, current->comm);
+       audit_log_untrustedstring(ab, get_task_comm(name, current));
        if (fname) {
                audit_log_format(ab, " name=");
                audit_log_untrustedstring(ab, fname);