Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5930883ybi; Tue, 4 Jun 2019 15:05:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqye8iDrWvcUEcVOf4f647nrMSXAG2m0P7ZANTN9bpwaBZuIIvC4rba7zxT1O49Qn2dwhTMZ X-Received: by 2002:a62:1a8e:: with SMTP id a136mr3927753pfa.22.1559685901850; Tue, 04 Jun 2019 15:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559685901; cv=none; d=google.com; s=arc-20160816; b=vjetYhmq50YlDvKcDKJiWRhj7fOWja+ies1q2YcO8croLsyRV6HAJVQtfz/Bn4J4Uz gUxHvyxLw6omplu0zSt5q5mjC0S1gjqcuI1udYeTMmEfh+trUxjepYPFwpsK2E6GylUH ZGctuocZtKX27JrE7QwIdwY8lFgMWVqB6Lwo5mQti5pLvbwxVsGb9N1DQ3CaC3nbr90F FHyiIcBao38bFc9N059kxY8SR7+irWHDLMNDg8zD/6syPbCOQx7KKz0pBkD7Yk8jg2ju Qc83lC6Q8m7Lm2OUDW+k4tBCpiUAMZYW5o8pIo5u3t0K0Krsn7HP5yZG6lqGzQ3ab5zV GtBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=it87Li8X1fzF6GnnpwKo6n6EaGmfjJ8Zx/rKpthubcA=; b=bg9vPpjBCPwwHwchhzsbpNnbljvim4xA/VI9Wqna7GN/zfa8TFpiIHhdue87SfjCPa cinaDjZiaket4dVrwldOC5DG/eGqbzXF1g/pVT79coaYeOp4OtMa1PmhTlDa9OhqHoj2 B2UHlXlm7c+9Nh1sMN422pUnvG8egFkwQavMhuLjmdT0SsBoA8LKJs/N4gqnpII5kJdE tk2kvHq9XERpZdMzVfvaA9jcs+He9egGr+LXmV22itkmbGJV2QuAGTYfjVlZLXZgi6/P VEALHyjzunt20XvjboltBp9vqQJzUFy9eJGvORtYQG8LCXqZYO1VoZrP3jof89fh/nSo a1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="nTT+jq/I"; 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 e1si9572499pgj.171.2019.06.04.15.04.45; Tue, 04 Jun 2019 15:05:01 -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; dkim=pass header.i=@yahoo.com header.s=s2048 header.b="nTT+jq/I"; 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 S1726613AbfFDWDU (ORCPT + 99 others); Tue, 4 Jun 2019 18:03:20 -0400 Received: from sonic316-13.consmr.mail.gq1.yahoo.com ([98.137.69.37]:37429 "EHLO sonic316-13.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726551AbfFDWDT (ORCPT ); Tue, 4 Jun 2019 18:03:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1559685798; bh=it87Li8X1fzF6GnnpwKo6n6EaGmfjJ8Zx/rKpthubcA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=nTT+jq/IkCSW8jSPuC7/EK2CCafFikNs7Nxw1eVCJ+35tu+RUoNf6sJppH8Cxcu9guKIcRsIi0BtfAMXkrqFVQIGBJex3tF/eMZQMYum1gvFy0BYx8GyRU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IY2vvMdt5dXSk_JPiJG5dE.NrEh07ZnqqIdH_x4aLpbdjemn8IL52g5RwXXe49 le0eJ.Kb9.XPXRg6WGwvRKcibf3p2Ghzef.jDRHCGtsk0CAiD6usMzguLVHdOwXBBMc4U85J_1qG _ZMzXpznr_1sdQcrJ0MqUlOwSDl7E.2aGTL5MIuDi9BPdtkwgCVyrujndwLwovXJ8aAYeQl_Pcrz 7xUCB8kLgHQPyA0N7g1oGsxLcrJp2fqI4e3mon_pop8RBkZv.x.H2O7l74wv8acwppXTLNMz_jqy 02.6ZisMlRLmOUY8yPAXLOLnvEmbajtyRQcQgD1iLs9gNICjrFcSCyFsvQjWLxj3yQ__jIyIA0eu 1MR0Str0aPbFZrspZqk.PnIKlARtm_dharD6lUxJPvhQMYTqiG9jUjp5YhTdyJEwWXM6IcG21_WW 4oVxGZgzfqg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.gq1.yahoo.com with HTTP; Tue, 4 Jun 2019 22:03:18 +0000 Received: from c-73-223-4-185.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([73.223.4.185]) by smtp413.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f9df356a2f48fa04da5bc0865b0d3777; Tue, 04 Jun 2019 22:03:14 +0000 (UTC) Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] To: Andy Lutomirski Cc: David Howells , Al Viro , raven@themaw.net, Linux FS Devel , Linux API , linux-block@vger.kernel.org, keyrings@vger.kernel.org, LSM List , LKML , casey@schaufler-ca.com References: <155966609977.17449.5624614375035334363.stgit@warthog.procyon.org.uk> <50c2ea19-6ae8-1f42-97ef-ba5c95e40475@schaufler-ca.com> From: Casey Schaufler Openpgp: preference=signencrypt Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx0UaM5r6Hj9lJm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/ij Dxf9HG2o5hOlMIAkJq/uLNMvABEBAAGJAjwEGAEIACYWIQQL720fVjJTAhDNQh44pRV8jEPI EQUCXNX0cAIbDAUJEswDAAAKCRA4pRV8jEPIEWkzEACKFUnpp+wIVHpckMfBqN8BE5dUbWJc GyQ7wXWajLtlPdw1nNw0Wrv+ob2RCT7qQlUo6GRLcvj9Fn5tR4hBvR6D3m8aR0AGHbcC62cq I7LjaSDP5j/em4oVL2SMgNTrXgE2w33JMGjAx9oBzkxmKUqprhJomPwmfDHMJ0t7y39Da724 oLPTkQDpJL1kuraM9TC5NyLe1+MyIxqM/8NujoJbWeQUgGjn9uxQAil7o/xSCjrWCP3kZDID vd5ZaHpdl8e1mTExQoKr4EWgaMjmD/a3hZ/j3KfTVNpM2cLfD/QwTMaC2fkK8ExMsz+rUl1H icmcmpptCwOSgwSpPY1Zfio6HvEJp7gmDwMgozMfwQuT9oxyFTxn1X3rn1IoYQF3P8gsziY5 qtTxy2RrgqQFm/hr8gM78RhP54UPltIE96VywviFzDZehMvuwzW//fxysIoK97Y/KBZZOQs+ /T+Bw80Pwk/dqQ8UmIt2ffHEgwCTbkSm711BejapWCfklxkMZDp16mkxSt2qZovboVjXnfuq wQ1QL4o4t1hviM7LyoflsCLnQFJh6RSBhBpKQinMJl/z0A6NYDkQi6vEGMDBWX/M2vk9Jvwa v0cEBfY3Z5oFgkh7BUORsu1V+Hn0fR/Lqq/Pyq+nTR26WzGDkolLsDr3IH0TiAVH5ZuPxyz6 abzjfg== Message-ID: <7645e662-8053-aeb4-ec79-57aa0bab4932@schaufler-ca.com> Date: Tue, 4 Jun 2019 15:03:12 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/4/2019 2:05 PM, Andy Lutomirski wrote: > On Tue, Jun 4, 2019 at 1:31 PM Casey Schaufler = wrote: >> n 6/4/2019 10:43 AM, Andy Lutomirski wrote: >>> On Tue, Jun 4, 2019 at 9:35 AM David Howells wr= ote: >>>> Hi Al, >>>> >>>> Here's a set of patches to add a general variable-length notificatio= n queue >>>> concept and to add sources of events for: >>> I asked before and didn't see a response, so I'll ask again. Why are= >>> you paying any attention at all to the creds that generate an event? >>> It seems like the resulting security model will be vary hard to >>> understand and probably buggy. Can't you define a sensible model in >>> which only the listener creds matter? >> We've spent the last 18 months reeling from the implications >> of what can happen when one process has the ability to snoop >> on another. Introducing yet another mechanism that is trivial >> to exploit is a very bad idea. > If you're talking about Spectre, etc, this is IMO entirely irrelevant. We're seeing significant interest in using obscure mechanisms in system exploits. Mechanisms will be exploited. > Among other things, setting these watches can and should require some > degree of privilege. Requiring privilege would address the concerns for most situations, although I don't see that it would help for SELinux. SELinux does not generally put much credence in what others consider "privilege". Extreme care would probably be required for namespaces, too. > >> I will try to explain the problem once again. If process A >> sends a signal (writes information) to process B the kernel >> checks that either process A has the same UID as process B >> or that process A has privilege to override that policy. >> Process B is passive in this access control decision, while >> process A is active. > Are you stating what you see to be a requirement? Basic subject/object access control is the core of the Linux security model. Yes, there are exceptions, but mostly they're historical in origin. >> Process A must have write access >> (defined by some policy) to process B's event buffer. > No, stop right here. Listening ... > Process B is monitoring some aspect of the > system. Process B is not "monitoring". At some point in the past it has registered a request for information should an event occur. It is currently passive. > Process A is doing something. Yes. It is active.' > Process B should need > permission to monitor whatever it's monitoring, OK, I'm good with that. But the only time you can tell that is when the event is registered, and at that time you can't tell who might be causing the event. (Or can you?) > and process A should > have permission to do whatever it's doing. So there needs to be some connection between what B can request events for and what events A can cause. Then you can deny B's requests because of A. > I don't think it makes > sense to try to ascribe an identity to the actor doing some action to > decide to omit it from the watch -- this has all kinds of correctness > issues. It works for signals and UDP, but in general I get the concern. > If you're writing a policy and you don't like letting process B spy on > processes doing various things, then disallow that type of spying. That gets you into a situation where you can't do the legitimate monitoring you want to do just because there's the off chance you might see something you shouldn't. "I hate security! It's confusing, and always gets in the way!" >> To >> implement such a policy requires A's credential, > You may not design a new mechanism that looks at the credential in a > context where looking at a credential is invalid unless you have some > very strong justification for why all of the known reasons that it's a > bad idea don't apply to what you're doing. Point. But you also don't get to ignore basic security policy just because someone's spiffy lazy memory free cache hashing tree (or similar mechanism) throws away references to important information while it's still needed. > So, without a much stronger justification, NAK. I try to be reasonable. Really. All I want is something with a security model that can be explained coherently=20 within the context of the basic Linux security model. There are enough variations as it is.