Received: by 10.192.165.156 with SMTP id m28csp1395103imm; Wed, 18 Apr 2018 09:00:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+wJb6/qO9GrkO/rAB0ZzqkdyISHtb5wunI1QsC+b8bWUbcYHXRoA5QQojF+5EoJNcBXDRl X-Received: by 10.99.122.5 with SMTP id v5mr2186023pgc.184.1524067242946; Wed, 18 Apr 2018 09:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524067242; cv=none; d=google.com; s=arc-20160816; b=A/hfqzmQarhX74Yjjgxa8E24aYpWvG+RhlVmnCGN8iBADGjSjac8pLOo/JA2SZhFzc Uf2FlLjB1s4V75sPlcfxGNddaZMpSHAxE2tUoq2wuiL6jLdy5F2sRVU6OOMFFC+iUYAJ zBprDqsEn535KOs+Y8NioWnDkgW0zUGqjd4SnnW0TynXxNGNC8FvPRAZBN+vsVXwtIv/ MX5aYybLHaICoGZj89ATJVwfqBtrehchKK0AAdsKvlLX8fH9fuXZEhZn5lD427dv6Tns t/oCn3109Crx1akzXtPw5QDz6XS0Std7dJEzg51dM4crfWgH4ZJY9AlewK77WScS4tQi wD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=HclTZYaK/HE9uUdiaj6E2f4wIOkLSv9Dz72nwPhX68E=; b=AAmhOu3Xp02EKjjs6JbsCivwuVi0HhdHxq2+a9ABN0/dalcZ6tCz88kT18Q1Ti1jkM om1LRICRrXVKJJ+5m88SlBuzB5umMEvqvLAtdKIn5KSym+J4Su8oEw5c5aMJABFimXb9 3+2y8F2PhWwIGqj9YLvgMqKg15CPuAV0GX3JeDgu715RwvDsPjQ0jibXXCPVHyI8MX3S H16C9Hp4IZO1gvC8F0CBaSiENEwEnRdYbp6uDnEYHW7aLwSPKipCKj++3w5FdG5IB2iB moQHnkaDSVxcr8Lww5FAYgNbJYsUD5MGFYgtGJbqSE+ipV5vgF6zzp/V8KZqBIKCIQWS +P/g== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9-v6si1465092plr.64.2018.04.18.09.00.28; Wed, 18 Apr 2018 09:00:42 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752762AbeDRP7S (ORCPT + 99 others); Wed, 18 Apr 2018 11:59:18 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:35398 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbeDRP7Q (ORCPT ); Wed, 18 Apr 2018 11:59:16 -0400 Received: from static-50-53-54-67.bvtn.or.frontiernet.net ([50.53.54.67] helo=[192.168.192.153]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1f8pUA-0005ud-Dy; Wed, 18 Apr 2018 15:59:06 +0000 Subject: Re: [RFC PATCH v3 1/3] ima: extend clone() with IMA namespace support To: Stefan Berger , "Eric W. Biederman" Cc: linux-integrity@vger.kernel.org, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, tycho@docker.com, serge@hallyn.com, sunyuqiong1988@gmail.com, david.safford@ge.com, mkayaalp@cs.binghamton.edu, James.Bottomley@HansenPartnership.com, zohar@linux.vnet.ibm.com, Yuqiong Sun , Mehmet Kayaalp References: <1522159038-14175-1-git-send-email-stefanb@linux.vnet.ibm.com> <1522159038-14175-2-git-send-email-stefanb@linux.vnet.ibm.com> <87sh8lcecn.fsf@xmission.com> From: John Johansen Organization: Canonical Message-ID: Date: Wed, 18 Apr 2018 08:59:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/28/2018 04:10 AM, Stefan Berger wrote: > On 03/27/2018 07:01 PM, Eric W. Biederman wrote: >> Stefan Berger writes: >> >>> From: Yuqiong Sun >>> >>> Add new CONFIG_IMA_NS config option.? Let clone() create a new IMA >>> namespace upon CLONE_NEWUSER flag. Attach the ima_ns data structure >>> to user_namespace. ima_ns is allocated and freed upon IMA namespace >>> creation and exit, which is tied to USER namespace creation and exit. >>> Currently, the ima_ns contains no useful IMA data but only a dummy >>> interface. This patch creates the framework for namespacing the different >>> aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal). >> Tying IMA to the user namespace is far better than tying IMA >> to the mount namespace.? It may even be the proper answer. >> >> >> You had asked what it would take to unstick this so you won't have >> problems next time you post and I did not get as far as answering. >> >> I had a conversation a while back with Mimi and I believe what was >> agreed was that IMA to start doing it's thing early needs a write >> to securityfs/imafs. > > Above you say 'proper answer' for user namespace. Now this sounds like making it independent. > Agreed, and if we want to broaden out to LSMs implementing namespacing keeping them independent is the correct solution >> >> As such I expect the best way to create the ima namespace is by simply >> writing to securityfs/imafs.? Possibly before the user namespace is >> even unshared.? That would allow IMA to keep track of things from >> before a container is created. > > So you are saying to not tie it to user namespace but make it an independent namespace and to not use a clone flag (0x1000) but use the filesystem to spawn a new namespace. Should that be an IMA specific file or a file that can be shared with other subsystems? > A clone flag could work for IMA, but I don't see it working for all the LSMs looking at or doing namespacing, especially if the stacking work ever lands. As for using an IMA specific file vs shared with the other subsystems, I think subsystem specific makes sense, that or we are going to have to design something that can be shared if LSM stacking ever lands.