Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1811696ima; Thu, 25 Oct 2018 05:28:35 -0700 (PDT) X-Google-Smtp-Source: AJdET5cB1k8dnfkd6bbqCJTJsxITb3BbqnhQZu4RKhXcqXJ/eE/AEjc7Jo9CyPs5HF5aBbAnkFf6 X-Received: by 2002:a17:902:59d6:: with SMTP id d22-v6mr1357166plj.116.1540470515084; Thu, 25 Oct 2018 05:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540470515; cv=none; d=google.com; s=arc-20160816; b=VHRaWp/JrJW8xv289Uhw5gmOypXpCHSy8GEQC91LALDLwCHKMYxg57EbKy1hlr9IXy X9zsz+Hu9/quwA64LfGTHkoWoND1qX/c+ZxrWHadCCZbigrU8Qm4Ic5q8suR7y4PQXo5 QHWAzIWaNP+ovkzW3WeQF4yN/le4S2F0gDt25kRrGoj8xBS5NaaKaaxyTQJqHyxtvViv FUHF8dHmi60Au1HfoLux7ru0izC5yTYOOxfIAwI5WtSCHnTu3/BH8x5cpuxxfJ0HAkgk ox7ORpK16gEi/MDyyjai9tzFnAPEFqHcINmJKcQlV/NLhQWO2ejtwu5qjcJUrxbSDgIn YJxw== 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; bh=/8j3QtqNbgvk+rePJs3HdT4rDyWedJ+eJamaJ4byUL4=; b=cC8LiWkXl+VsTULLQDsSJDgzq+LoL8q+AlUm86f0oHR7WWm9uXmHTRvk5rsvoDjwnc Hm0xmg51gDDPDz8yRvW3qodUQvRDP8ABCqoVrtB8SBg9pE7TfUMr2jnJ5DTA89VqulQf B/bu4lqk8ZhstQcWlBHtO/B/C/ofHnQmivHLPbTZcCF933Wahh3C/9o0Hv0Vh1/fDpE9 kmFGQ7aZOqnF9TB9cTFzXyDf9Stv3HVI9x0a9KK1Vd21uSgvuPAzWhpRyM6Wka61DORL rEPvd9j6Gn/nzKrXOH4eaLkaPn8cYiGQuFbGf2IxU93M51TDdDJMhQDhrOBbfjohMq47 0DZQ== 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 t7-v6si6312030pgn.270.2018.10.25.05.28.19; Thu, 25 Oct 2018 05:28:35 -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 S1727460AbeJYVAV (ORCPT + 99 others); Thu, 25 Oct 2018 17:00:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727256AbeJYVAV (ORCPT ); Thu, 25 Oct 2018 17:00:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFDAC3DBE9; Thu, 25 Oct 2018 12:27:46 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-24.phx2.redhat.com [10.3.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E2F3608F3; Thu, 25 Oct 2018 12:27:35 +0000 (UTC) Date: Thu, 25 Oct 2018 08:27:32 -0400 From: Richard Guy Briggs To: Paul Moore Cc: sgrubb@redhat.com, simo@redhat.com, carlos@redhat.com, linux-api@vger.kernel.org, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, linux-audit@redhat.com, netfilter-devel@vger.kernel.org, ebiederm@xmission.com, luto@kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, Eric Paris , Serge Hallyn , viro@zeniv.linux.org.uk Subject: Re: [PATCH ghak90 (was ghak32) V4 03/10] audit: log container info of syscalls Message-ID: <20181025122732.4j4rbychjse3gemt@madcap2.tricolour.ca> References: <34017c395d03a213d6b0d49b9964429bd32b283d.1533065887.git.rgb@redhat.com> <20181024151439.lavhanabsyxdrdvo@madcap2.tricolour.ca> <20181025004255.zl7p7j6gztouh2hh@madcap2.tricolour.ca> <20181025080638.771621a3@ivy-bridge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 25 Oct 2018 12:27:47 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-25 06:49, Paul Moore wrote: > On Thu, Oct 25, 2018 at 2:06 AM Steve Grubb wrote: > > On Wed, 24 Oct 2018 20:42:55 -0400 > > Richard Guy Briggs wrote: > > > On 2018-10-24 16:55, Paul Moore wrote: > > > > On Wed, Oct 24, 2018 at 11:15 AM Richard Guy Briggs > > > > wrote: > > > > > On 2018-10-19 19:16, Paul Moore wrote: > > > > > > On Sun, Aug 5, 2018 at 4:32 AM Richard Guy Briggs > > > > > > wrote: > > ... > > > > > > > > +/* > > > > > > > + * audit_log_contid - report container info > > > > > > > + * @tsk: task to be recorded > > > > > > > + * @context: task or local context for record > > > > > > > + * @op: contid string description > > > > > > > + */ > > > > > > > +int audit_log_contid(struct task_struct *tsk, > > > > > > > + struct audit_context *context, > > > > > > > char *op) +{ > > > > > > > + struct audit_buffer *ab; > > > > > > > + > > > > > > > + if (!audit_contid_set(tsk)) > > > > > > > + return 0; > > > > > > > + /* Generate AUDIT_CONTAINER record with container ID > > > > > > > */ > > > > > > > + ab = audit_log_start(context, GFP_KERNEL, > > > > > > > AUDIT_CONTAINER); > > > > > > > + if (!ab) > > > > > > > + return -ENOMEM; > > > > > > > + audit_log_format(ab, "op=%s contid=%llu", > > > > > > > + op, audit_get_contid(tsk)); > > > > > > > + audit_log_end(ab); > > > > > > > + return 0; > > > > > > > +} > > > > > > > +EXPORT_SYMBOL(audit_log_contid); > > > > > > > > > > > > As discussed in the previous iteration of the patch, I prefer > > > > > > AUDIT_CONTAINER_ID here over AUDIT_CONTAINER. If you feel > > > > > > strongly about keeping it as-is with AUDIT_CONTAINER I suppose > > > > > > I could live with that, but it is isn't my first choice. > > > > > > > > > > I don't have a strong opinion on this one, mildly preferring the > > > > > shorter one only because it is shorter. > > > > > > > > We already have multiple AUDIT_CONTAINER* record types, so it seems > > > > as though we should use "AUDIT_CONTAINER" as a prefix of sorts, > > > > rather than a type itself. > > > > > > I'm fine with that. I'd still like to hear Steve's input. He had > > > stronger opinions than me. > > > > The creation event should be separate and distinct from the continuing > > use when its used as a supplemental record. IOW, binding the ID to a > > container is part of the lifecycle and needs to be kept distinct. > > Steve's comment is pretty ambiguous when it comes to AUDIT_CONTAINER > vs AUDIT_CONTAINER_ID, but one could argue that AUDIT_CONTAINER_ID > helps distinguish the audit container id marking record and gets to > what I believe is the spirit of Steve's comment. Taking this in > context with my previous remarks, let's switch to using > AUDIT_CONTAINER_ID. I suspect Steve is mixing up AUDIT_CONTAINER_OP with AUDIT_CONTAINER_ID, confusing the fact that they are two seperate records. As a summary, the suggested records are: CONTAINER_OP audit container identifier creation CONTAINER audit container identifier aux record to an event and what Paul is suggesting (which is fine by me) is: CONTAINER_OP audit container identifier creation event CONTAINER_ID audit container identifier aux record to an event Steve, please indicate you are fine with this. > paul moore - 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