fix ima breakage
[linux-2.6.git] / security / lsm_audit.c
index 94b8684..acba3df 100644 (file)
@@ -187,7 +187,7 @@ static inline void print_ipv6_addr(struct audit_buffer *ab,
                                   char *name1, char *name2)
 {
        if (!ipv6_addr_any(addr))
-               audit_log_format(ab, " %s=%pI6", name1, addr);
+               audit_log_format(ab, " %s=%pI6c", name1, addr);
        if (port)
                audit_log_format(ab, " %s=%d", name2, ntohs(port));
 }
@@ -220,6 +220,8 @@ static void dump_common_audit_data(struct audit_buffer *ab,
        }
 
        switch (a->type) {
+       case LSM_AUDIT_NO_AUDIT:
+               return;
        case LSM_AUDIT_DATA_IPC:
                audit_log_format(ab, " key=%d ", a->u.ipc_id);
                break;
@@ -271,11 +273,11 @@ static void dump_common_audit_data(struct audit_buffer *ab,
                        case AF_INET: {
                                struct inet_sock *inet = inet_sk(sk);
 
-                               print_ipv4_addr(ab, inet->rcv_saddr,
-                                               inet->sport,
+                               print_ipv4_addr(ab, inet->inet_rcv_saddr,
+                                               inet->inet_sport,
                                                "laddr", "lport");
-                               print_ipv4_addr(ab, inet->daddr,
-                                               inet->dport,
+                               print_ipv4_addr(ab, inet->inet_daddr,
+                                               inet->inet_dport,
                                                "faddr", "fport");
                                break;
                        }
@@ -284,10 +286,10 @@ static void dump_common_audit_data(struct audit_buffer *ab,
                                struct ipv6_pinfo *inet6 = inet6_sk(sk);
 
                                print_ipv6_addr(ab, &inet6->rcv_saddr,
-                                               inet->sport,
+                                               inet->inet_sport,
                                                "laddr", "lport");
                                print_ipv6_addr(ab, &inet6->daddr,
-                                               inet->dport,
+                                               inet->inet_dport,
                                                "faddr", "fport");
                                break;
                        }
@@ -352,6 +354,10 @@ static void dump_common_audit_data(struct audit_buffer *ab,
                }
                break;
 #endif
+       case LSM_AUDIT_DATA_KMOD:
+               audit_log_format(ab, " kmod=");
+               audit_log_untrustedstring(ab, a->u.kmod_name);
+               break;
        } /* switch (a->type) */
 }