Received: by 10.223.185.116 with SMTP id b49csp154509wrg; Fri, 2 Mar 2018 15:45:03 -0800 (PST) X-Google-Smtp-Source: AG47ELsQvK7btFe18ObwlpXNYduhZkFZm8a/bXMcv6Z/Hxqj31Fyv+xpY+HAMqOjlK5S+kZwvLbp X-Received: by 2002:a17:902:5596:: with SMTP id g22-v6mr6536200pli.4.1520034303700; Fri, 02 Mar 2018 15:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520034303; cv=none; d=google.com; s=arc-20160816; b=PtcrRCqiCOO9p0+3/aqmo+nBtgZrruGNj0QSkWmSQhthM2MZiIQunIrVQNKk/40nwU xNyP0Ab1WipNXjjmSdxIF8oYqCaV6C5aTFIFQxn14VgvN3LAXThiZw4Y23PppWYPJ2kX oNI5f7urqeIDG7qELfnTPVs18fllq8E48zPTVdi5P9h8WaSEgguezBANi6s9giqu5rEf B6J7jQ+atey5IuUB2cCAGPI0Dw3D4o065a5OLuvKY/c3zO7q19QoWwcKyKK+LnIOzkZr oHB32V8B7AuDnf6idkMeaT1lTFFJVQLtwkrtisw8tPIY+I8fQTzWZxjzxdH5KK8BGBVP n+Og== 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=RzC7mzhl9/5UwZPvcmGVDC+p4iMf/BjL4aBgcB2e4bg=; b=zdUK7bDsmdfPTC9kkix1XYMGspEum9UZ6/wkhj5hwPsOy9MEJQI8LcyujggwgRlgHF HIMly+ElqcnXfn+P6K9jn9gBDMk0wTPUnSd6nwANVBxk96Q3i9d99lbri9AIo5xiKep4 AmU2VhbXmKas71p76V7PhCBL0D+87Aie0B/phda+oje/UIHezz3plzgB+E2xh7wODD7c ak/s3Jsm/7cKFZbPeIp9u39vyUCzpX/cimw/YEYxfBjkL5wx8u6+GkwMWfNot93uOSe4 SkoDbiyPJ/NaKBzSac4SjTcSeklkiw/nK6jWE4e5r9h88N6s8QM2iNKwiBxqCmT4rzC4 igfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore-com.20150623.gappssmtp.com header.s=20150623 header.b=JPDMsPOp; 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 b195si4700781pga.552.2018.03.02.15.44.49; Fri, 02 Mar 2018 15:45:03 -0800 (PST) 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=JPDMsPOp; 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 S1424877AbeCBPst (ORCPT + 99 others); Fri, 2 Mar 2018 10:48:49 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:39162 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425223AbeCBPsp (ORCPT ); Fri, 2 Mar 2018 10:48:45 -0500 Received: by mail-lf0-f53.google.com with SMTP id f75so13979275lfg.6 for ; Fri, 02 Mar 2018 07:48:44 -0800 (PST) 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=RzC7mzhl9/5UwZPvcmGVDC+p4iMf/BjL4aBgcB2e4bg=; b=JPDMsPOpLGpt9ef4XkVmzYF6TGHbvAdjjZaMEv1dHYRzRiuiR20tQrNxswnV6YYmir IgzCFQphBv5ifRvztbFhvo2seUCjOCFUCg/LAg06EBUG1bkXCX/It1bxt7olgkG4K3ic rlMECJEhNntGA9qsewiYa2Ol/WWh8BYEe0j9nGj5bpzSmfa8jfgMH17CCjnUnaQN9jTT qQnjMDn5Fv63y5v4TIeMQiwKTIX1OJ7KFvCo8qKdbxKTGKCBEVsRkSQ7Bq2hqodS0HtA QFTjmJbFx4q5Ags6k6tJT1mCl3KqxocqrU96662F6ikFXDa8dAjiF1Yqufkl7ScTGJYf sl6g== 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=RzC7mzhl9/5UwZPvcmGVDC+p4iMf/BjL4aBgcB2e4bg=; b=WwlS+KfDaeyWg4rYSR2mWT1wECnlabjrZ2h7Zxc+eWSpv28uMcrTzknXzScCDKqOCl fiaGiyJJUAVFBQ8gYWSqbtTWL9pZflg8yOG7klh26TzTo4zDzageC+ffeul9SacU5NfC KMV2y0dOn2irLkh0yg9ajl44B9kNVEQW0f3AEsukAWzr+nhga15O0yD45si1BpXfxGL+ rlYSGvcyYVzJ/cmDZVnmD6mQ4aAEfPZuyn9NUVBhOx1jjl4aCGzqzzo64BabY5WHB8FZ M3/TFO6obkfUDy7e++ZYJx4bXhoZkMBmBB83iEFLAbAcEHdDzGTEVGk9YJllZuqoX3Vv kcQg== X-Gm-Message-State: AElRT7FGXyhye1K//YCN9mTNqFz+kOClFna+HV+KTWWe1B3BrUpqY2fo TsGi2FDEzIz9RXtYib0gvcUU7BbrzcvOioNyGQgG X-Received: by 10.25.198.23 with SMTP id w23mr4118977lff.40.1520005723320; Fri, 02 Mar 2018 07:48:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.216.167 with HTTP; Fri, 2 Mar 2018 07:48:42 -0800 (PST) X-Originating-IP: [108.20.156.165] In-Reply-To: <20180302014101.jtfd2eeyxmvxcjpf@madcap2.tricolour.ca> References: <2e5d93ee46feca915a101c2fc3062da674a98223.1519930146.git.rgb@redhat.com> <20180302014101.jtfd2eeyxmvxcjpf@madcap2.tricolour.ca> From: Paul Moore Date: Fri, 2 Mar 2018 10:48:42 -0500 Message-ID: Subject: Re: [RFC PATCH V1 01/12] audit: add container id 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, mszeredi@redhat.com, ebiederm@xmission.com, simo@redhat.com, jlayton@redhat.com, carlos@redhat.com, dhowells@redhat.com, viro@zeniv.linux.org.uk, luto@kernel.org, Eric Paris , trondmy@primarydata.com, 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 Thu, Mar 1, 2018 at 8:41 PM, Richard Guy Briggs wrote: > On 2018-03-01 14:41, Richard Guy Briggs wrote: >> Implement the proc fs write to set the audit container ID of a process, >> emitting an AUDIT_CONTAINER record to document the event. >> >> This is a write from the container orchestrator task to a proc entry of >> the form /proc/PID/containerid where PID is the process ID of the newly >> created task that is to become the first task in a container, or an >> additional task added to a container. >> >> The write expects up to a u64 value (unset: 18446744073709551615). >> >> This will produce a record such as this: >> type=UNKNOWN[1333] msg=audit(1519903238.968:261): op=set pid=596 uid=0 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 auid=0 tty=pts0 ses=1 opid=596 old-contid=18446744073709551615 contid=123455 res=0 >> >> The "op" field indicates an initial set. The "pid" to "ses" fields are >> the orchestrator while the "opid" field is the object's PID, the process >> being "contained". Old and new container ID values are given in the >> "contid" fields, while res indicates its success. >> >> It is not permitted to self-set, unset or re-set the container ID. A >> child inherits its parent's container ID, but then can be set only once >> after. > > There are more restrictions coming later: > - check that the child being set has no children or threads yet, or > forcibly set them all to the same container ID (assuming they all pass > the same tests). This will also prevent an orch from setting its > parent and other tit-for-tat games to circumvent the basic checks. FYI, I think you may have a problem with something in your outgoing mail path; I didn't receive the original patchset you are referencing and it doesn't appear in the mail archive either. -- paul moore www.paul-moore.com