Received: by 10.192.165.156 with SMTP id m28csp119522imm; Wed, 18 Apr 2018 18:33:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48LszfUhR9f3TzDgOdppJQOZEPujL+KJz7KK0gvMD+iPImgIh5Dhxs5R12attxrRCBkSnDY X-Received: by 10.98.10.131 with SMTP id 3mr3913073pfk.112.1524101600816; Wed, 18 Apr 2018 18:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524101600; cv=none; d=google.com; s=arc-20160816; b=tXDozhrb1KlimrapKeXpwn6qQgDixZsPk3dhDug9/lp8gQn5GRx7nsGcGSKJvIVzvx iWQzstD0/4XH7imNuTJeJsHclvjnyJ2beUaBOykZJk1M3XOVo8hg5x9vS5jXVgVQR9tW 1Bd6NNgYuM9yhZe4wAw0Af1J25O0Em7Uk/dDHos15M+p7udHR5Fe5dr2E9riaODCME85 3KvXirKq4ZWzgSDgJFwQ9kzzjlQmWg1njbIoLFXefwprYCfo+Jb8z6WrT2POWHC4xmmZ VSOzJnhiofP1Fwup+9IBDmIngOqPBPi6YUPQlc8EgBX1rZLk/Riebr5vyJKzBWLOBym6 GNag== 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=hFnTgqsRJKL6Dng+FS5/SZHOeFFcayKGQiaq1E2R3Yg=; b=zgKVZnjJ74gairDnH9LYOwVeDmgPeEtdYWHVy+6ux/skD3EQevyHxDjpqgMDIXwE5V w5ufRqtZI20mTfjfAxxo057kpsNi4mrWIvNMYhe+2bBHwQtDoxtCZ3rMoKEo+MBc6nQb NJFQ6r65lk2DZ9I6/w2SkxpCfDgzZwiKSsUHDleULqSEd0abJASi4vXvCj6rsI2vCeQE eN1WiMJH5vlYUmPujutFPFaMzp6Kh9uUmmRSFUSQY5i/BEsOAHEDVDpqo7/J6AmGk2DU kzzWKVBstJMRmKocY+nzdU/t2z6zX4D7uUTBEP96P1aMCES2+w0QKQbKQXP82Kwx7/sv AKqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=RWILuyGj; 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 r15-v6si2376255pls.524.2018.04.18.18.33.07; Wed, 18 Apr 2018 18:33:20 -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=RWILuyGj; 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 S1752903AbeDSBb4 (ORCPT + 99 others); Wed, 18 Apr 2018 21:31:56 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:37987 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbeDSBbx (ORCPT ); Wed, 18 Apr 2018 21:31:53 -0400 Received: by mail-lf0-f65.google.com with SMTP id z130-v6so5350441lff.5 for ; Wed, 18 Apr 2018 18:31:52 -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=hFnTgqsRJKL6Dng+FS5/SZHOeFFcayKGQiaq1E2R3Yg=; b=RWILuyGjZCRMJKvckQL2f7994SqaJI49bbd9mBJeAkA/emTLMG4fNlpSJEvAXa3KeD 0lhz7NREN1DZ7Zbm7F+t3SA6C3uKCYTaYVt/+XTRPXToIJDqMtjQ1K6cvS5/rKuG3Fhu ifXI0SGdpE6n5QfnCwrqz7n2FseX6q0DzNb+eZiq/i8BnpdjRkaIe9cg77PzZqlI3x4X D1unvLuApYF9uN3ZtBKfrTsmLs3NlXAF67hkABK34/kQ9g+vX56YtKh66W8wdNlE39he 99uwtZ+Z8Xg8r5mprFZezauSYEQ0r11D3YuuPQnPRnviCYv0k2IkXSleGqmbzP1xqVfP rQ+A== 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=hFnTgqsRJKL6Dng+FS5/SZHOeFFcayKGQiaq1E2R3Yg=; b=RoeUjxnEQax9XhadzBpqItHV3aCreaMrjJMb7jed96ByxAQUUn5PqHDvZQo2UuJgb8 5ToTsXRcvFRubbEotvTwdMpzsmExNlgCXLSVlt7xMmWwH2kCQTcl67687hj8unhbbDNL UiEPMLhFfSSelu4OEOtuPqgIGphe/8VE6FumeNr+aAFyi6cgpixXDuAt0fTJPcUFi0np mXNF/OhzFuevq6Kfw/bxp+oE1mmRGz43H8Hm2AiYfAYX+yRZ2nSDj1uKP/g6LqC1T946 jJE5qq8xV7J+F4xUbxCA1OXQt9Y1ynOJN8+tmRlwDmIsjn/z+Oaxt2mp/1O8WUToPCDI aApQ== X-Gm-Message-State: ALQs6tD+3l1Gcp8rnHoT5d0c3URTHOgQvUSNB8c2fxQkuuZ2Uw/M/TuQ M1oQDodLfg2mu6IYuOqEpCnmNvyldQFALXDA6HFi X-Received: by 2002:a19:b587:: with SMTP id g7-v6mr2935104lfk.90.1524101511523; Wed, 18 Apr 2018 18:31:51 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a19:a5c3:0:0:0:0:0 with HTTP; Wed, 18 Apr 2018 18:31:50 -0700 (PDT) X-Originating-IP: [108.20.156.165] In-Reply-To: <11174597083f89352f1d6491ec94e27f882625d9.1521179281.git.rgb@redhat.com> References: <11174597083f89352f1d6491ec94e27f882625d9.1521179281.git.rgb@redhat.com> From: Paul Moore Date: Wed, 18 Apr 2018 21:31:50 -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: 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, ebiederm@xmission.com, luto@kernel.org, jlayton@redhat.com, carlos@redhat.com, dhowells@redhat.com, viro@zeniv.linux.org.uk, simo@redhat.com, Eric Paris , serge@hallyn.com 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 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. > - 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