Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7021970imm; Tue, 24 Jul 2018 07:11:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSSEK8+40+w41HuT9+bept4Lyd5BJg+0pTyvUvmzPeZLvA3OjIwwhjlOoWg6YYY6QhHoDx X-Received: by 2002:a62:2119:: with SMTP id h25-v6mr17613426pfh.112.1532441484907; Tue, 24 Jul 2018 07:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532441484; cv=none; d=google.com; s=arc-20160816; b=GcKGMCO5KkAMEDD3iYQAZo9QoyIl8okbLBSEC9aXPP42o2+sOCybJnQYhcGMLQf2aD OHHKjxQQLjBhPHWbv1UzL7VoxyfiMptBqYkWaBKI2HquBmZvqQxikQIs2F7akzV3vc7I +vhTlAuPijt2MEphBqxy3yfgYZI6MZMAPLZ40MCyUgJfxWSNKPndVWJgYuM3jIWOzKxU eYw+NR4xDizq6Gkb0rMDMyTjc5D5Hxj717w1mOwN9K4J8G1LjGpozKxmSBKf2CRIVnpl Cm2sUuOO2SP69xtb8gq1LK3Aj9Tjb6OXioImxiWwq5xRCtacqebhjSkNcNwA51dgkH/7 Nuxg== 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=GXhP6nvxqvenco2R5f0AeEapH+dkR2e07nGmo4CcOnY=; b=UNRot6rTgtisblmvAQ4j0WLU45zf7GmjwJOvRcoKB/blxJsyes9SYhrFtBphp8Slii DvpmYJ4fJxldxdAgD18MMzYOurm0K3Zs7/kckxNHExVnMdo4CLXaxuaW5gd5n+CDGPS7 lPwTTw5lQmwXm+Mzz6sAAvARlHASh01OBbVyVjIy9qWJiOIDUA0t0q/H2R9vajXEOKxh Vo6q/DrpdxX//FuuXSuobaciNiGE1nKW19TozpfmfhBFYnX6pmpRIHbt6gcwCREC+G8g cPZGDiirSiiamzDn1Vyd/I2/lJ2toBNTkNP8ucLKehHbwHMRAJE4RyXpjBHqOvOedCNt HMDg== 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 v6-v6si10847473ply.300.2018.07.24.07.11.09; Tue, 24 Jul 2018 07:11:24 -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 S2388460AbeGXPQ7 (ORCPT + 99 others); Tue, 24 Jul 2018 11:16:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44226 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388320AbeGXPQ6 (ORCPT ); Tue, 24 Jul 2018 11:16:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E085A401EF17; Tue, 24 Jul 2018 14:10:17 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-54.rdu2.redhat.com [10.10.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A1D952027047; Tue, 24 Jul 2018 14:10:14 +0000 (UTC) Date: Tue, 24 Jul 2018 10:07:21 -0400 From: Richard Guy Briggs To: Paul Moore Cc: cgroups@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-audit@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, 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 Subject: Re: [RFC PATCH ghak90 (was ghak32) V3 05/10] audit: add containerid support for tty_audit Message-ID: <20180724140721.yyi5e7y3czxsjwug@madcap2.tricolour.ca> References: <28ab8ad3c4e5de6f61b928eeb2af030b04a8820b.1528304204.git.rgb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180512 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Jul 2018 14:10:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 24 Jul 2018 14:10:17 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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-07-20 18:14, Paul Moore wrote: > On Wed, Jun 6, 2018 at 1:04 PM Richard Guy Briggs wrote: > > Add audit container identifier auxiliary record to tty logging rule > > event standalone records. > > > > Signed-off-by: Richard Guy Briggs > > --- > > drivers/tty/tty_audit.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c > > index e30aa6b..66bd850 100644 > > --- a/drivers/tty/tty_audit.c > > +++ b/drivers/tty/tty_audit.c > > @@ -66,8 +66,9 @@ static void tty_audit_log(const char *description, dev_t dev, > > uid_t uid = from_kuid(&init_user_ns, task_uid(tsk)); > > uid_t loginuid = from_kuid(&init_user_ns, audit_get_loginuid(tsk)); > > unsigned int sessionid = audit_get_sessionid(tsk); > > + struct audit_context *context = audit_alloc_local(); > > We should be using current's audit_context in tty_audit_log(). > Actually, we should probably just get rid of the tsk variable in > tty_audit_log() and use current directly to make things a bit more > obvious. Ok, agreed. At this point, it it current passed in anyways so no harm other than efficiency. >