Received: by 10.192.165.148 with SMTP id m20csp131531imm; Thu, 19 Apr 2018 17:49:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx49YRTs5OTI2dHDPMzzU7DU9+AVe98JCUW8piQn2xsUqwnlZgK+D2j2mnyVySGxaQrintIfH X-Received: by 2002:a17:902:be18:: with SMTP id r24-v6mr8046124pls.275.1524185390306; Thu, 19 Apr 2018 17:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524185390; cv=none; d=google.com; s=arc-20160816; b=jD1OD9GzwGAcA8UvglnByQpE4OCrEGa/jUGBr1RwQ4X5M3nUdMLbC2zjpCf8VB/pGz Uh+1jCPHBziDZCqBtfJ55X1Bt+eqXeJbWx9qmapm3i7FTz5AD56H8KDRcizZLOEyM9pf x5us6X8tq2JS9vrLpF+XU3VMFCjwaT/3PAYwhIKMVdr8Axvky+NlgCKQ2j7D8YxL6Nys hdI0qK/H9YsQ4K6EKSpLbpw8Ni+S5qzuAxp6sw+Ytz34XmNbpFXkYAiM4b1wruqy7ezF 119cWlx59B+d3tNpg/2Q4b0YN2axJ3zRzHHCXXtk1OB+e5HChwo+lOaYltNYcvUFomxa BOAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=5uMzvOg57CY7KCp3GI2FxkRGd0OGii8bEjQZPcq7IKY=; b=Nm+W0VllphaeasrBEbXfC7UDW7YUnTihN3YzCL7dRbVs4MAkm9WtQY2SI2Ge9Y7EEF 9xxPkGqbNgsSWy8/MLYfl8BxjJmIdX48dAAf4IsBk3O/oz1T0mnkcwsawQ3j8rMBPK7J owTI3kUrIAKKOeUFsypE4YrKqpsy2RCA39XX7r1vRKsdIMiDQNZcvA/pa8H9T1phhCmX ZZXM4Prf7HhDoNlwvplxLQyWyYfCj52dTohNh1RQPAj069tuaXWXdlwchxJgCbkMjvSB MDhNSfd/nV/Ar3o14M80dPfA/4xo+KuIQ3+s1vbZxUwnI0SydRGip+ShEeJE3uhEknX6 Lp5A== 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 o12-v6si1244061plg.463.2018.04.19.17.49.36; Thu, 19 Apr 2018 17:49:50 -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 S1754050AbeDTAs3 (ORCPT + 99 others); Thu, 19 Apr 2018 20:48:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59118 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754029AbeDTAsZ (ORCPT ); Thu, 19 Apr 2018 20:48:25 -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 C755B81A88D5; Fri, 20 Apr 2018 00:48:24 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 61D8210EE964; Fri, 20 Apr 2018 00:48:14 +0000 (UTC) Date: Thu, 19 Apr 2018 20:42:18 -0400 From: Richard Guy Briggs To: Paul Moore Cc: simo@redhat.com, jlayton@redhat.com, carlos@redhat.com, linux-api@vger.kernel.org, containers@lists.linux-foundation.org, LKML , Eric Paris , dhowells@redhat.com, Linux-Audit Mailing List , ebiederm@xmission.com, luto@kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, serge@hallyn.com, viro@zeniv.linux.org.uk Subject: Re: [RFC PATCH ghak32 V2 10/13] audit: add containerid support for seccomp and anom_abend records Message-ID: <20180420004218.tgndd474wgueyjzk@madcap2.tricolour.ca> References: <11174597083f89352f1d6491ec94e27f882625d9.1521179281.git.rgb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171027 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.8]); Fri, 20 Apr 2018 00:48:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 20 Apr 2018 00:48:24 +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 On 2018-04-18 21:31, Paul Moore wrote: > On Fri, Mar 16, 2018 at 5:00 AM, Richard Guy Briggs wrote: > > 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(); > > Looking quickly at do_coredump() I *believe* we can use current here. > > > 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(); > > We can definitely use current here. Ok, so both syscall aux records. That elimintes this patch from the set, can go in independently. > > - 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) > > -- > paul moore > www.paul-moore.com > > -- > Linux-audit mailing list > Linux-audit@redhat.com > https://www.redhat.com/mailman/listinfo/linux-audit - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635