NetLabel: honor the audit_enabled flag
The audit_enabled flag is used to signal when syscall auditing is to be performed. While NetLabel uses a Netlink interface instead of syscalls, it is reasonable to consider the NetLabel Netlink interface as a form of syscall so pay attention to the audit_enabled flag when generating audit messages in NetLabel. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
committed by
David S. Miller
parent
3de4bab5b9
commit
de64688ffb
@ -46,6 +46,10 @@
|
||||
#include "netlabel_cipso_v4.h"
|
||||
#include "netlabel_user.h"
|
||||
|
||||
/* do not do any auditing if audit_enabled == 0, see kernel/audit.c for
|
||||
* details */
|
||||
extern int audit_enabled;
|
||||
|
||||
/*
|
||||
* NetLabel NETLINK Setup Functions
|
||||
*/
|
||||
@ -101,6 +105,9 @@ struct audit_buffer *netlbl_audit_start_common(int type,
|
||||
char *secctx;
|
||||
u32 secctx_len;
|
||||
|
||||
if (audit_enabled == 0)
|
||||
return NULL;
|
||||
|
||||
audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
|
||||
if (audit_buf == NULL)
|
||||
return NULL;
|
||||
|
Reference in New Issue
Block a user