Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp405imm; Thu, 27 Sep 2018 14:46:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV623Ph1OMoWtLOj+rrzWp3ndnteRmMYhGhp/EIsw/tMNO1juPwxworjDn4WK6uQb1TlNw9ye X-Received: by 2002:a17:902:292a:: with SMTP id g39-v6mr3994632plb.269.1538084776018; Thu, 27 Sep 2018 14:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538084775; cv=none; d=google.com; s=arc-20160816; b=omDrPhNNdVLZoAHqsaYG2Fhv9Wgi+uSKSP9u3im5KkFFTSfKZhO5FvuqHMExqpIaAb K/QUU6RQJKM4eTsi3wC0Hsl4IN4rbSm1PsOFg82plUj8q9JZaYjfoTg2UCZuS53q7kVR 5JTzcxMLADvwDBLamC8Go8+Ie1jclpk0TCYHk1Xbo7cbaX0WXZvqh98Gl+GoGZRGIuZy SrfvupHj2rIlscuSS3GGIuEa69Ap034jCzpsjBIZTw9XtTS1DEhwHgcTZkbekGeIG3oR 720zPB0bfmzjR74gfkdfl4+KjdQ9CY5Ou9RKDK/qDR29stwkkPoK7A5LGyaHU44JNece 5Otg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=f7DucOl7Q9SF4gHF97XXzIG3Egd7wKD2KxJVcdvV13E=; b=1KCoi4bl36+lYRLPgwXYCchOEPWBQ3V1D+0FawHg+r/1FJFXLH9KCqvmXCACuL9oBa 5ryg/nhQZmxr2LTYHYlJwaCVbv3/r/koWAeWpMduVIllPkuTpVQnrNw/R9lV2usmcfsj etXrLlSE33oE9ZjVM1RX4pYFyEef6RUpPuAFvl4B3Nr7tDxIrOBsV7mWkgvvo7VIh1Lf zAGPcyc/C+ZFMav6qlWxVdyJ3c3frBDPEeXQx5WeaS/uYUOnaHjZDopoRfgQB/DNC7L0 7qeazDKZkqRrSFN7SD0LtI2Ft8LeBVj3NyN/YWj7602UJR6KvbsK5qtB1L0x+20DfnnL R6WA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si2757626pgj.425.2018.09.27.14.46.00; Thu, 27 Sep 2018 14:46:15 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726717AbeI1EFm (ORCPT + 99 others); Fri, 28 Sep 2018 00:05:42 -0400 Received: from namei.org ([65.99.196.166]:33444 "EHLO namei.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725727AbeI1EFm (ORCPT ); Fri, 28 Sep 2018 00:05:42 -0400 Received: from localhost (localhost [127.0.0.1]) by namei.org (8.14.4/8.14.4) with ESMTP id w8RLj0nW009134; Thu, 27 Sep 2018 21:45:00 GMT Date: Fri, 28 Sep 2018 07:45:00 +1000 (AEST) From: James Morris To: Casey Schaufler cc: kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, selinux@tycho.nsa.gov, dave.hansen@intel.com, deneen.t.dock@intel.com, kristen@linux.intel.com, arjan@linux.intel.com Subject: Re: [PATCH v5 5/5] sidechannel: Linux Security Module for sidechannel In-Reply-To: <20180926203446.2004-6-casey.schaufler@intel.com> Message-ID: References: <20180926203446.2004-1-casey.schaufler@intel.com> <20180926203446.2004-6-casey.schaufler@intel.com> User-Agent: Alpine 2.21 (LRH 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Sep 2018, Casey Schaufler wrote: > + /* > + * Namespace checks. Considered safe if: > + * cgroup namespace is the same > + * User namespace is the same > + * PID namespace is the same > + */ > + if (current->nsproxy) > + ccgn = current->nsproxy->cgroup_ns; > + if (p->nsproxy) > + pcgn = p->nsproxy->cgroup_ns; > + if (ccgn != pcgn) > + return -EACCES; > + if (current->cred->user_ns != p->cred->user_ns) > + return -EACCES; > + if (task_active_pid_ns(current) != task_active_pid_ns(p)) > + return -EACCES; > + return 0; I really don't like the idea of hard-coding namespace security semantics in an LSM. Also, I'm not sure if these semantics make any sense. It least make it user configurable. -- James Morris