Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5885287ybi; Tue, 4 Jun 2019 14:07:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi6+S2HdNQcZtSA9e9IKqFwjG0YUReriXYkwCm96WB37kVcb1ykH4yVjPGfuKrHmL0Ixhs X-Received: by 2002:a63:d816:: with SMTP id b22mr780087pgh.16.1559682453198; Tue, 04 Jun 2019 14:07:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559682453; cv=none; d=google.com; s=arc-20160816; b=BRuI/3/iQeu/oasnAV8zmx7rJGIfk2l1qK1OKEZWCbYjVlcmvqq0TlRfgWZ5wLp+iv xVxpOq74EFmQISKVCoivrsjb54BuCsgTeoDy8HZcjcbusO+pgFUEbOIyY2vzPzaeRtBU ahSYwE5IIKlA1euBTAYPXpo8ksoOAk7EgmMZ5n428/H461nUb3HAJwr00QyEKN26NR26 Jp3vW0Fvvq2/gB8rQhBtJBgd/mp+6EpWVtNOucq3ngC8mDJhVhNEy0gbsL5AMsmFDejR RwqkAdkuF7Y8MP5QYayv5lKn9wD0zrqSi8r4ecluAakTLdqdKd5ddUwUnWe6hBH1pwW1 TNag== 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 :in-reply-to:references:mime-version:dkim-signature; bh=JsDnPODbnf1dYFy6hJjyeMPQDJM8N7DFcQxXFZpv2Wg=; b=bz5nD6ys09XGx4sIdGc/MW1HHDeUfB/Xu8POQvr0I5F4lu99tXFn2fB09BUISq/C2x 9gc3OOqQDha8YqdOF/Ga3JqWCzcw/hDOIVGtNNoG2xCk9FWFwJutNXHj+reWOjE7Mkrl trjOsdQ5xD7pYetF1F5Wzr7ZZsVLr2L/kwGYxMJ8XCG7+i9qxJtAKYCjdRm4nhgBJz9o c4sUwivtY2RrDjjsqt1kV3LzWTtzHv+TJ1QeMy08nVOAb97Us5JRHdU1EzdqFF8Gsze1 XlaHDlNi3xlOByDY5CGUoDwSnB7wKGHxut2IlD0YFv6L4vblEJTBxP0UCRIdGe1EFdfY CMag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bKqwlkPK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si25541088pfn.225.2019.06.04.14.07.16; Tue, 04 Jun 2019 14:07:33 -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=@kernel.org header.s=default header.b=bKqwlkPK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbfFDVGM (ORCPT + 99 others); Tue, 4 Jun 2019 17:06:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:49002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfFDVGL (ORCPT ); Tue, 4 Jun 2019 17:06:11 -0400 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0DF6520848 for ; Tue, 4 Jun 2019 21:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559682370; bh=i3+PKArC81hAWWLFbR8rIjiNLUgLS1GNbVkf2UNoyBM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=bKqwlkPKaQ3IQwvOCkKHXE+fzBVNdDjtVlr7a+sbKhSCUKTUtA8ntH7W5HPaRk3cF FQ95lopQQpPwX8nBCY+csk1ilQnGCG2HV2qZbusup4nVUZEXUnUw+k5ieoz+YRTMhC UEVU/VuriAEepnLf0S6xfYHwCp4+ginYnqC93Jyk= Received: by mail-wr1-f47.google.com with SMTP id c2so17289347wrm.8 for ; Tue, 04 Jun 2019 14:06:09 -0700 (PDT) X-Gm-Message-State: APjAAAUicyptU440LAmgF2g23e9ZqPJ8gIWSRAESPVx/YlNpt5uPzcmq 2L5gxxvzTPsBhtR6TRrK8sEI+UqGG5NLlUo8DV5CEA== X-Received: by 2002:a5d:6207:: with SMTP id y7mr4033435wru.265.1559682368626; Tue, 04 Jun 2019 14:06:08 -0700 (PDT) MIME-Version: 1.0 References: <155966609977.17449.5624614375035334363.stgit@warthog.procyon.org.uk> <50c2ea19-6ae8-1f42-97ef-ba5c95e40475@schaufler-ca.com> In-Reply-To: <50c2ea19-6ae8-1f42-97ef-ba5c95e40475@schaufler-ca.com> From: Andy Lutomirski Date: Tue, 4 Jun 2019 14:05:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] To: Casey Schaufler Cc: Andy Lutomirski , David Howells , Al Viro , raven@themaw.net, Linux FS Devel , Linux API , linux-block@vger.kernel.org, keyrings@vger.kernel.org, LSM List , LKML 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 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 wrote: > >> > >> Hi Al, > >> > >> Here's a set of patches to add a general variable-length notification 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. Among other things, setting these watches can and should require some degree of privilege. > > 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? > Process A must have write access > (defined by some policy) to process B's event buffer. No, stop right here. Process B is monitoring some aspect of the system. Process A is doing something. Process B should need permission to monitor whatever it's monitoring, and process A should have permission to do whatever it's doing. 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. 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. > 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. So, without a much stronger justification, NAK.