Received: by 10.192.165.148 with SMTP id m20csp443734imm; Fri, 20 Apr 2018 09:12:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/0wZsVfG1CIzkxlqGFY7unu5pr+1fhsd7+ZhhnZa80C8X92CguQdSIVAD2b/b3BsUa1ZhU X-Received: by 10.98.108.69 with SMTP id h66mr10298028pfc.43.1524240762545; Fri, 20 Apr 2018 09:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524240762; cv=none; d=google.com; s=arc-20160816; b=dQ5pMqNGbAhhYVz13lkwENDLxPSP5yRFHGqB5VTGMRJ9JTKZmVIAps+UZeRqbkdTBT KW3dS55abyi3353xTlJsl2v8AFHbYmxXIWdZaAyVj5/KAbCnjFXb4xw6QeD5IVg/DnYm CSVDXxeevh4TORxc5MnIVajrajKHDcvUSKiSsEkEYGLzdRt8saNE/wHD6pqaXlw4YTNS 2VCkao92zEz3f/uhauZySXV3tVyKPGQmcT5uVX6AjkBU0bjWywITi3k06hMoWRBynY8F 33fUqwIIKYq7wIV+cUqmeCWtcMjbHY2FzsNnkoaj36hf0bJ5jhHRAQKG4BOQIbSjdh5P isMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=J2oRhGOKHzdaHs6mdrkAQjFk4kUR+KOyBN0t2P5/krQ=; b=HHgrJDCb4Elljpzy32q7VjvlisBDAh/kmovpIhnyDaP8nWG8PW3seItD3FMSwIn/AZ jFiTof31sVEjCl5+ENC0dtfqjhRPfv6/Fa/rNqflqrlJXp996H9Me9nNnsGkLQQuaWyr 3Cs34hco8G9sHX7ZrnCUm2VGdUq6Xism0adcVO0Kbpi5iHjf2Xi+NHCk40edpey2DXjj 6r3KeaInLwH5gkPHc2aAPmyAhG+Dyw6hGLLsgH7T9hqBzFVQnHVbq5TrHGlrYhg8K4cM Y1qcB7APLulHBHU/dg/PyJaqF4r205ea/krbhNsgVlOKc9YLgjb5XAKI8Z4AwB4Y+F6V RO0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=E0emYWXc; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5-v6si5888599plt.209.2018.04.20.09.12.28; Fri, 20 Apr 2018 09:12:42 -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; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=E0emYWXc; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbeDTQLP (ORCPT + 99 others); Fri, 20 Apr 2018 12:11:15 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:41084 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbeDTQLM (ORCPT ); Fri, 20 Apr 2018 12:11:12 -0400 Received: by mail-lf0-f67.google.com with SMTP id o123-v6so3321859lfe.8 for ; Fri, 20 Apr 2018 09:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=J2oRhGOKHzdaHs6mdrkAQjFk4kUR+KOyBN0t2P5/krQ=; b=E0emYWXcFxvE7WPU8DiXOKRNAFtMGEzVOAyLNkrphAwCOQ4XDntic3Fb1L+gL/ujfM l1oyoXlXxa62zqtXhnJp8Yrf/bRsp6DshJux/JH/ZibjkJSxxPZTUSwPgix52sUaoURG 3gMZS1fOXLEwIAN42xpCQOMMimiGUtuWydGWBIXdHReG4MsQYtKj2bAxLfctmuPAZ4uo WZC93c+sZ+Wjdy1cTPNi0RYAk0ng+WyQI2wWqv0PRfB+fEcRQlQxfXLnom5ejCNTaboL anw+Acbq7JIhZdgVyhEsQsPXcS+eKwP5gpYHnTLBNvvUzN3b04pRW4LTE814D4RnKOHq Vk5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=J2oRhGOKHzdaHs6mdrkAQjFk4kUR+KOyBN0t2P5/krQ=; b=lMf403Pp78Ta3XaOgNRAcYZrTMZjGpZeeHOwkAq9ddvAOzoc2/3s3Vx+f4uMbJzexY A8qwvL/ijuSHcoHgL8GyqfVFyrtrBvVfiQQXUnmo0srNQuvhXVRFZhRTtLEbSSvlt0kl JGFFN7f5017DWQUylFBZFU1frhfgY9Ibb223yiMwS/V+4t3Ea3kY8aWv1HYY6KSz0ErD tJiLztw2AtLolfURRn+630Wk5T43qUW8LdJVsVX3G2OP4T5b0dlvtZbpVvlhVdDIsP9v 5TJK5MbpLVzFl1N9T3c2BEVb5h2F2Lu1pz2ZLxnz8W0YvDnRt9ZGq051Hwy/9kC+eQYW iulw== X-Gm-Message-State: ALQs6tCJCqbV+zEWXI/YF+cfMyxEPzFTy41Uov+01eD6Q09Y3++jblXc 179H2gTO3/W7HNXTmmVApfv3mmeNYW9iKpW3qh/k X-Received: by 10.46.153.206 with SMTP id l14mr7309819ljj.87.1524240670536; Fri, 20 Apr 2018 09:11:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:a5c3:0:0:0:0:0 with HTTP; Fri, 20 Apr 2018 09:11:09 -0700 (PDT) X-Originating-IP: [108.20.156.165] In-Reply-To: <20180420004218.tgndd474wgueyjzk@madcap2.tricolour.ca> References: <11174597083f89352f1d6491ec94e27f882625d9.1521179281.git.rgb@redhat.com> <20180420004218.tgndd474wgueyjzk@madcap2.tricolour.ca> From: Paul Moore Date: Fri, 20 Apr 2018 12:11:09 -0400 Message-ID: Subject: Re: [RFC PATCH ghak32 V2 10/13] audit: add containerid support for seccomp and anom_abend records To: Richard Guy Briggs 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 19, 2018 at 8:42 PM, Richard Guy Briggs wrote: > 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. Yep. It should help shrink the audit container ID patchset and perhaps more importantly it should put some distance between the connected-record debate and the audit container ID debate. I understand we are going to need a "local" context for some things, the network packets are probably the best example, but whenever possible I would like to connect these records back to a task's context. -- paul moore www.paul-moore.com