Received: by 10.213.65.68 with SMTP id h4csp261458imn; Fri, 16 Mar 2018 02:11:39 -0700 (PDT) X-Google-Smtp-Source: AG47ELsvUervz6MBK49MLY0ZdQ80hGsKVlD/9xI5WRa7BhC3TAJaOKYeoqth6ahvgS9KsvscBd19 X-Received: by 10.98.131.4 with SMTP id h4mr953433pfe.156.1521191499674; Fri, 16 Mar 2018 02:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521191499; cv=none; d=google.com; s=arc-20160816; b=cM7QQyTHgUri+tgJ80jDBseaUi9gqFcAhFs1zFPImG7Owvooyuhqdti3pXylcAUpUh JXC05IV78DR7eiY2gYikDX3J3fV3ius81uEX7DzjvpJayrj1Wcc6U/I+taAn7QdzupRn 8pPIARZ070+wNJz8OTGeaPA4ULM8iHh1IHNNWkm5YReRwbW9Dibb/rNTJrgOF28g4swp hJHxwzIqx2KjbvSzrd8TI3qyGb/PhGN5it0qn15ANVuQk96u3QPNrUNx5CQqNIoNyXH2 T+qgxgcV5qXzQWb7xbC091jG0Gsujd36o55TiG5RVl5VW5Vhsm8Ux4nA5a3Vj1gq3cHG rIKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9OyUgmojaGrZSPrsBMcKC1ED+Nv6ZahoHBhSnmaE/7k=; b=YmEDohC93YCQMs3ZuK2WIEKE1uKr1aszcJtyD/jvET8ju6GyTVR8CYNvpcwEUCdGqu pjeeT8A39IbZDeURJ5OggfZAzAVrhobr13ERCzFQOWVd22eyelAe8UuuLNqRcpkSRZzO iWhz/DfW2+GpVQYWkEtQtMBIAVggWCK/G3bh1P2RTvnEKqNK0rmv+Nq+JbX++daflWx7 KTi13BZKmQzLhYt9//Ei37DE3TTD8U3JGFb1AjAVoKidjPdrUQerG+F5FhaI+NTVvjeB TTPTW37dZaOgbSOIcLgfLxYC1JxOT8/MhNuMVtmbiB28RetcmNLmfqDsnYK+0bhwMMPo 58Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si4748629pge.286.2018.03.16.02.11.25; Fri, 16 Mar 2018 02:11:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753229AbeCPJJC (ORCPT + 99 others); Fri, 16 Mar 2018 05:09:02 -0400 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 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B530401DE7F; Fri, 16 Mar 2018 09:07:10 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id A57AC10B009F; Fri, 16 Mar 2018 09:07:06 +0000 (UTC) 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: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 09:07:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 09:07:10 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rgb@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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