From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51432 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752048AbeCPJHK (ORCPT ); Fri, 16 Mar 2018 05:07:10 -0400 From: Richard Guy Briggs To: cgroups@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, LKML , netdev@vger.kernel.org Cc: luto@kernel.org, jlayton@redhat.com, carlos@redhat.com, viro@zeniv.linux.org.uk, dhowells@redhat.com, simo@redhat.com, eparis@parisplace.org, serge@hallyn.com, ebiederm@xmission.com, madzcar@gmail.com, Richard Guy Briggs Subject: [RFC PATCH ghak32 V2 10/13] audit: add containerid support for seccomp and anom_abend records Date: Fri, 16 Mar 2018 05:00:37 -0400 Message-Id: <11174597083f89352f1d6491ec94e27f882625d9.1521179281.git.rgb@redhat.com> In-Reply-To: References: In-Reply-To: References: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Add container ID auxiliary records to secure computing and abnormal end standalone records. Signed-off-by: Richard Guy Briggs --- kernel/auditsc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 7103d23..2f02ed9 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2571,6 +2571,7 @@ static void audit_log_task(struct audit_buffer *ab) void audit_core_dumps(long signr) { struct audit_buffer *ab; + struct audit_context *context = audit_alloc_local(); if (!audit_enabled) return; @@ -2578,19 +2579,22 @@ void audit_core_dumps(long signr) if (signr == SIGQUIT) /* don't care for those */ return; - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_ANOM_ABEND); + ab = audit_log_start(context, GFP_KERNEL, AUDIT_ANOM_ABEND); if (unlikely(!ab)) return; audit_log_task(ab); audit_log_format(ab, " sig=%ld res=1", signr); audit_log_end(ab); + audit_log_container_info(context, "abend", audit_get_containerid(current)); + audit_free_context(context); } void __audit_seccomp(unsigned long syscall, long signr, int code) { struct audit_buffer *ab; + struct audit_context *context = audit_alloc_local(); - ab = audit_log_start(NULL, GFP_KERNEL, AUDIT_SECCOMP); + ab = audit_log_start(context, GFP_KERNEL, AUDIT_SECCOMP); if (unlikely(!ab)) return; audit_log_task(ab); @@ -2598,6 +2602,8 @@ void __audit_seccomp(unsigned long syscall, long signr, int code) signr, syscall_get_arch(), syscall, in_compat_syscall(), KSTK_EIP(current), code); audit_log_end(ab); + audit_log_container_info(context, "seccomp", audit_get_containerid(current)); + audit_free_context(context); } struct list_head *audit_killed_trees(void) -- 1.8.3.1