Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3942878ybi; Fri, 19 Jul 2019 11:48:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwg8LxypfhjKtMMg4mdwdT04U31sqNQqVI7W2gcym1eqJUFov3LJBbOewyK/RvD7p/rvI4v X-Received: by 2002:a17:90a:9f4a:: with SMTP id q10mr59319180pjv.95.1563562101336; Fri, 19 Jul 2019 11:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563562101; cv=none; d=google.com; s=arc-20160816; b=OSzfop/mOu6IebQPSS0nykz5roOd0rdfxkEWymw8LuSVDkoQT4lCoB8YXU7MCDpWKj M9yyRDNSvrNeCcn1uQnqS4gTIUKCJbsnagNmGsrXJY1cXJ5DUAa/6rWdqK55rPxXFKR7 2MwMAjrm4DUQmVoMcX6mocO+w0sr9P+3ynLA+bB67xhK/o7kkvojIeVKet8LMwRNcK8M //prkCg/Ch09X5fjioYqjH0IOZtDir+r34y23q51JsSMlyLF/ArGkGWq1sl6D1JL3yE+ 5r2dw7ObkooDCzQ0xMTILmRigT4cgfhuJHSaseod2f3EJD9lx+B1U5J40o2JwneP9LL9 6gpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:mime-version:user-agent :message-id:in-reply-to:date:references:cc:to:from; bh=TqGY5WXdUVIHr5PtcJVxF9wmoEHL1Ps/6gINAyfrAW4=; b=gA5/xXKLDl1DWgJ6ggLSnVJ6wDdjvGxZNfGjGMvYe2hvQjKIGtBpjNLUF8RjlZKj+a t9ZDsYB/H8angunvdPzCcB2D6M2JiSjpAXyHB346Av6TlO26HlRYiq/VGCcfO8kAhMda i7pf7Q6AFZC2apdS7eYCpn2+Cl9Muhm+3i6HkGpkJBheoTqxtWRZMYb+JGSwP9TPP6Sy NtfSGWSyJ+DDq5dQDVeYOXdLk7UA//AcYqaKuzUNP/T2ogcfraLt6fVNtEcHggec6Frj qj3dO/HD/+h6M+fp9wgES1bDKwiT2Pm2F5+Nz//XNl+Hp+B38m9tQVefsFpPWq/Fqpoc iBSg== 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=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s21si2446386pfm.225.2019.07.19.11.48.05; Fri, 19 Jul 2019 11:48:21 -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=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728768AbfGSPcd (ORCPT + 99 others); Fri, 19 Jul 2019 11:32:33 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:48180 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726072AbfGSPcc (ORCPT ); Fri, 19 Jul 2019 11:32:32 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out03.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1hoUs1-0002I0-Fb; Fri, 19 Jul 2019 09:32:29 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95] helo=x220.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1hoUs0-0005zu-CO; Fri, 19 Jul 2019 09:32:29 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: Richard Guy Briggs Cc: Paul Moore , "Serge E. Hallyn" , Tycho Andersen , containers@lists.linux-foundation.org, linux-api@vger.kernel.org, Linux-Audit Mailing List , linux-fsdevel@vger.kernel.org, LKML , netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, sgrubb@redhat.com, omosnace@redhat.com, dhowells@redhat.com, simo@redhat.com, Eric Paris , nhorman@tuxdriver.com References: <20190529153427.GB8959@cisco> <20190529222835.GD8959@cisco> <20190530170913.GA16722@mail.hallyn.com> <20190708180558.5bar6ripag3sdadl@madcap2.tricolour.ca> <20190716220320.sotbfqplgdructg7@madcap2.tricolour.ca> <20190718005145.eshekqfr3navqqiy@madcap2.tricolour.ca> Date: Fri, 19 Jul 2019 10:32:13 -0500 In-Reply-To: <20190718005145.eshekqfr3navqqiy@madcap2.tricolour.ca> (Richard Guy Briggs's message of "Wed, 17 Jul 2019 20:51:45 -0400") Message-ID: <874l3ighvm.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1hoUs0-0005zu-CO;;;mid=<874l3ighvm.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+51FYWsW8BRSUlMyR1nWn6IFnz4uCKOTQ= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Richard Guy Briggs X-Spam-Relay-Country: X-Spam-Timing: total 656 ms - load_scoreonly_sql: 0.06 (0.0%), signal_user_changed: 2.9 (0.4%), b_tie_ro: 1.94 (0.3%), parse: 0.88 (0.1%), extract_message_metadata: 3.3 (0.5%), get_uri_detail_list: 1.18 (0.2%), tests_pri_-1000: 7 (1.0%), tests_pri_-950: 1.56 (0.2%), tests_pri_-900: 1.50 (0.2%), tests_pri_-90: 23 (3.6%), check_bayes: 22 (3.3%), b_tokenize: 7 (1.1%), b_tok_get_all: 6 (0.9%), b_comp_prob: 1.93 (0.3%), b_tok_touch_all: 4.5 (0.7%), b_finish: 0.60 (0.1%), tests_pri_0: 598 (91.1%), check_dkim_signature: 0.56 (0.1%), check_dkim_adsp: 2.2 (0.3%), poll_dns_idle: 0.60 (0.1%), tests_pri_10: 2.2 (0.3%), tests_pri_500: 6 (0.9%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH ghak90 V6 02/10] audit: add container id X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Richard Guy Briggs writes: > On 2019-07-16 19:30, Paul Moore wrote: >> On Tue, Jul 16, 2019 at 6:03 PM Richard Guy Briggs wrote: >> > On 2019-07-15 17:04, Paul Moore wrote: >> > > On Mon, Jul 8, 2019 at 2:06 PM Richard Guy Briggs wrote: >> >> > > > At this point I would say we are at an impasse unless we trust >> > > > ns_capable() or we implement audit namespaces. >> > > >> > > I'm not sure how we can trust ns_capable(), but if you can think of a >> > > way I would love to hear it. I'm also not sure how namespacing audit >> > > is helpful (see my above comments), but if you think it is please >> > > explain. >> > >> > So if we are not namespacing, why do we not trust capabilities? >> >> We can trust capable(CAP_AUDIT_CONTROL) for enforcing audit container >> ID policy, we can not trust ns_capable(CAP_AUDIT_CONTROL). > > Ok. So does a process in a non-init user namespace have two (or more) > sets of capabilities stored in creds, one in the init_user_ns, and one > in current_user_ns? Or does it get stripped of all its capabilities in > init_user_ns once it has its own set in current_user_ns? If the former, > then we can use capable(). If the latter, we need another mechanism, as > you have suggested might be needed. The latter. There is only one set of capabilities and it is in the processes current user namespace. Eric