Lines Matching refs:ab
387 struct audit_buffer *ab; in audit_log_config_change() local
390 ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_CONFIG_CHANGE); in audit_log_config_change()
391 if (unlikely(!ab)) in audit_log_config_change()
393 audit_log_format(ab, "op=set %s=%u old=%u ", function_name, new, old); in audit_log_config_change()
394 audit_log_session_info(ab); in audit_log_config_change()
395 rc = audit_log_task_context(ab); in audit_log_config_change()
398 audit_log_format(ab, " res=%d", allow_changes); in audit_log_config_change()
399 audit_log_end(ab); in audit_log_config_change()
1088 struct audit_buffer **ab, u16 msg_type) in audit_log_common_recv_msg() argument
1094 *ab = NULL; in audit_log_common_recv_msg()
1098 *ab = audit_log_start(context, GFP_KERNEL, msg_type); in audit_log_common_recv_msg()
1099 if (unlikely(!*ab)) in audit_log_common_recv_msg()
1101 audit_log_format(*ab, "pid=%d uid=%u ", pid, uid); in audit_log_common_recv_msg()
1102 audit_log_session_info(*ab); in audit_log_common_recv_msg()
1103 audit_log_task_context(*ab); in audit_log_common_recv_msg()
1106 static inline void audit_log_user_recv_msg(struct audit_buffer **ab, in audit_log_user_recv_msg() argument
1109 audit_log_common_recv_msg(NULL, ab, msg_type); in audit_log_user_recv_msg()
1132 struct audit_buffer *ab; in audit_log_feature_change() local
1137 ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_FEATURE_CHANGE); in audit_log_feature_change()
1138 if (!ab) in audit_log_feature_change()
1140 audit_log_task_info(ab); in audit_log_feature_change()
1141 audit_log_format(ab, " feature=%s old=%u new=%u old_lock=%u new_lock=%u res=%d", in audit_log_feature_change()
1144 audit_log_end(ab); in audit_log_feature_change()
1222 struct audit_buffer *ab; in audit_receive_msg() local
1395 audit_log_user_recv_msg(&ab, msg_type); in audit_receive_msg()
1399 audit_log_format(ab, " msg='%.*s'", in audit_receive_msg()
1403 audit_log_format(ab, " data="); in audit_receive_msg()
1406 audit_log_n_untrustedstring(ab, str, data_len); in audit_receive_msg()
1408 audit_log_end(ab); in audit_receive_msg()
1416 audit_log_common_recv_msg(audit_context(), &ab, in audit_receive_msg()
1418 audit_log_format(ab, " op=%s audit_enabled=%d res=0", in audit_receive_msg()
1422 audit_log_end(ab); in audit_receive_msg()
1432 audit_log_common_recv_msg(audit_context(), &ab, in audit_receive_msg()
1434 audit_log_format(ab, " op=trim res=1"); in audit_receive_msg()
1435 audit_log_end(ab); in audit_receive_msg()
1463 audit_log_common_recv_msg(audit_context(), &ab, in audit_receive_msg()
1465 audit_log_format(ab, " op=make_equiv old="); in audit_receive_msg()
1466 audit_log_untrustedstring(ab, old); in audit_receive_msg()
1467 audit_log_format(ab, " new="); in audit_receive_msg()
1468 audit_log_untrustedstring(ab, new); in audit_receive_msg()
1469 audit_log_format(ab, " res=%d", !err); in audit_receive_msg()
1470 audit_log_end(ab); in audit_receive_msg()
1511 struct audit_buffer *ab; in audit_receive_msg() local
1531 audit_log_common_recv_msg(audit_context(), &ab, in audit_receive_msg()
1533 audit_log_format(ab, " op=tty_set old-enabled=%d new-enabled=%d" in audit_receive_msg()
1537 audit_log_end(ab); in audit_receive_msg()
1604 struct audit_buffer *ab; in audit_log_multicast() local
1609 ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_EVENT_LISTENER); in audit_log_multicast()
1610 if (!ab) in audit_log_multicast()
1615 audit_log_format(ab, "pid=%u uid=%u auid=%u tty=%s ses=%u", in audit_log_multicast()
1622 audit_log_task_context(ab); /* subj= */ in audit_log_multicast()
1623 audit_log_format(ab, " comm="); in audit_log_multicast()
1624 audit_log_untrustedstring(ab, get_task_comm(comm, current)); in audit_log_multicast()
1625 audit_log_d_path_exe(ab, current->mm); /* exe= */ in audit_log_multicast()
1626 audit_log_format(ab, " nl-mcgrp=%d op=%s res=%d", group, op, !err); in audit_log_multicast()
1627 audit_log_end(ab); in audit_log_multicast()
1779 static void audit_buffer_free(struct audit_buffer *ab) in audit_buffer_free() argument
1781 if (!ab) in audit_buffer_free()
1784 kfree_skb(ab->skb); in audit_buffer_free()
1785 kmem_cache_free(audit_buffer_cache, ab); in audit_buffer_free()
1791 struct audit_buffer *ab; in audit_buffer_alloc() local
1793 ab = kmem_cache_alloc(audit_buffer_cache, gfp_mask); in audit_buffer_alloc()
1794 if (!ab) in audit_buffer_alloc()
1797 ab->skb = nlmsg_new(AUDIT_BUFSIZ, gfp_mask); in audit_buffer_alloc()
1798 if (!ab->skb) in audit_buffer_alloc()
1800 if (!nlmsg_put(ab->skb, 0, 0, type, 0, 0)) in audit_buffer_alloc()
1803 ab->ctx = ctx; in audit_buffer_alloc()
1804 ab->gfp_mask = gfp_mask; in audit_buffer_alloc()
1806 return ab; in audit_buffer_alloc()
1809 audit_buffer_free(ab); in audit_buffer_alloc()
1864 struct audit_buffer *ab; in audit_log_start() local
1915 ab = audit_buffer_alloc(ctx, gfp_mask, type); in audit_log_start()
1916 if (!ab) { in audit_log_start()
1921 audit_get_stamp(ab->ctx, &t, &serial); in audit_log_start()
1925 audit_log_format(ab, "audit(%llu.%03lu:%u): ", in audit_log_start()
1928 return ab; in audit_log_start()
1939 static inline int audit_expand(struct audit_buffer *ab, int extra) in audit_expand() argument
1941 struct sk_buff *skb = ab->skb; in audit_expand()
1943 int ret = pskb_expand_head(skb, 0, extra, ab->gfp_mask); in audit_expand()
1961 static void audit_log_vformat(struct audit_buffer *ab, const char *fmt, in audit_log_vformat() argument
1968 if (!ab) in audit_log_vformat()
1971 BUG_ON(!ab->skb); in audit_log_vformat()
1972 skb = ab->skb; in audit_log_vformat()
1975 avail = audit_expand(ab, AUDIT_BUFSIZ); in audit_log_vformat()
1985 avail = audit_expand(ab, in audit_log_vformat()
2007 void audit_log_format(struct audit_buffer *ab, const char *fmt, ...) in audit_log_format() argument
2011 if (!ab) in audit_log_format()
2014 audit_log_vformat(ab, fmt, args); in audit_log_format()
2029 void audit_log_n_hex(struct audit_buffer *ab, const unsigned char *buf, in audit_log_n_hex() argument
2036 if (!ab) in audit_log_n_hex()
2039 BUG_ON(!ab->skb); in audit_log_n_hex()
2040 skb = ab->skb; in audit_log_n_hex()
2046 avail = audit_expand(ab, new_len); in audit_log_n_hex()
2062 void audit_log_n_string(struct audit_buffer *ab, const char *string, in audit_log_n_string() argument
2069 if (!ab) in audit_log_n_string()
2072 BUG_ON(!ab->skb); in audit_log_n_string()
2073 skb = ab->skb; in audit_log_n_string()
2077 avail = audit_expand(ab, new_len); in audit_log_n_string()
2119 void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, in audit_log_n_untrustedstring() argument
2123 audit_log_n_hex(ab, string, len); in audit_log_n_untrustedstring()
2125 audit_log_n_string(ab, string, len); in audit_log_n_untrustedstring()
2136 void audit_log_untrustedstring(struct audit_buffer *ab, const char *string) in audit_log_untrustedstring() argument
2138 audit_log_n_untrustedstring(ab, string, strlen(string)); in audit_log_untrustedstring()
2142 void audit_log_d_path(struct audit_buffer *ab, const char *prefix, in audit_log_d_path() argument
2148 audit_log_format(ab, "%s", prefix); in audit_log_d_path()
2151 pathname = kmalloc(PATH_MAX+11, ab->gfp_mask); in audit_log_d_path()
2153 audit_log_format(ab, "\"<no_memory>\""); in audit_log_d_path()
2159 audit_log_format(ab, "\"<too_long>\""); in audit_log_d_path()
2161 audit_log_untrustedstring(ab, p); in audit_log_d_path()
2165 void audit_log_session_info(struct audit_buffer *ab) in audit_log_session_info() argument
2170 audit_log_format(ab, "auid=%u ses=%u", auid, sessionid); in audit_log_session_info()
2173 void audit_log_key(struct audit_buffer *ab, char *key) in audit_log_key() argument
2175 audit_log_format(ab, " key="); in audit_log_key()
2177 audit_log_untrustedstring(ab, key); in audit_log_key()
2179 audit_log_format(ab, "(null)"); in audit_log_key()
2182 int audit_log_task_context(struct audit_buffer *ab) in audit_log_task_context() argument
2200 audit_log_format(ab, " subj=%s", ctx); in audit_log_task_context()
2210 void audit_log_d_path_exe(struct audit_buffer *ab, in audit_log_d_path_exe() argument
2222 audit_log_d_path(ab, " exe=", &exe_file->f_path); in audit_log_d_path_exe()
2226 audit_log_format(ab, " exe=(null)"); in audit_log_d_path_exe()
2246 void audit_log_task_info(struct audit_buffer *ab) in audit_log_task_info() argument
2252 if (!ab) in audit_log_task_info()
2257 audit_log_format(ab, in audit_log_task_info()
2275 audit_log_format(ab, " comm="); in audit_log_task_info()
2276 audit_log_untrustedstring(ab, get_task_comm(comm, current)); in audit_log_task_info()
2277 audit_log_d_path_exe(ab, current->mm); in audit_log_task_info()
2278 audit_log_task_context(ab); in audit_log_task_info()
2289 struct audit_buffer *ab; in audit_log_path_denied() local
2295 ab = audit_log_start(audit_context(), GFP_KERNEL, type); in audit_log_path_denied()
2296 if (!ab) in audit_log_path_denied()
2298 audit_log_format(ab, "op=%s", operation); in audit_log_path_denied()
2299 audit_log_task_info(ab); in audit_log_path_denied()
2300 audit_log_format(ab, " res=0"); in audit_log_path_denied()
2301 audit_log_end(ab); in audit_log_path_denied()
2329 struct audit_buffer *ab; in audit_log_set_loginuid() local
2336 ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_LOGIN); in audit_log_set_loginuid()
2337 if (!ab) in audit_log_set_loginuid()
2345 audit_log_format(ab, "pid=%d uid=%u", task_tgid_nr(current), uid); in audit_log_set_loginuid()
2346 audit_log_task_context(ab); in audit_log_set_loginuid()
2347 audit_log_format(ab, " old-auid=%u auid=%u tty=%s old-ses=%u ses=%u res=%d", in audit_log_set_loginuid()
2351 audit_log_end(ab); in audit_log_set_loginuid()
2425 void audit_log_end(struct audit_buffer *ab) in audit_log_end() argument
2430 if (!ab) in audit_log_end()
2434 skb = ab->skb; in audit_log_end()
2435 ab->skb = NULL; in audit_log_end()
2448 audit_buffer_free(ab); in audit_log_end()
2466 struct audit_buffer *ab; in audit_log() local
2469 ab = audit_log_start(ctx, gfp_mask, type); in audit_log()
2470 if (ab) { in audit_log()
2472 audit_log_vformat(ab, fmt, args); in audit_log()
2474 audit_log_end(ab); in audit_log()