Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7077879ybi; Wed, 5 Jun 2019 10:50:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzWa1TRBWZsKSrqvG/JhdDALpTAsaNHMVkcNcRooMlz39mst27ZkkKdxJcGiN2P5GIWriTR X-Received: by 2002:a17:902:7297:: with SMTP id d23mr31563051pll.254.1559757009028; Wed, 05 Jun 2019 10:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559757009; cv=none; d=google.com; s=arc-20160816; b=Y+eMGvQwAYMZ9YsqTy70neQqo/WddQld4AXRN07hDQ5z2HVRbF1s8m8mwuZeQbuDSS oWmXzT8Ctwz/keCigW7R2yHPzzboO2T2j+1fI13goHaUqY6j3rc7eF3nZsnD1nJEYyqr lhZyL90d9EfzcegPG8TDgnjgVs7rQOfEpTVdQzbXGXGi23hVnICTU/fkvh5dZQKsXIyi q9chUtaqVj08w4WQVdZjbm5S7Wp2NvJK4C4j4LXuSUlVOGNIufNAGrE1J5m6xB/u+0Pn LAmYYL1NrVRJkL2GSRME0dfmv2ypgrvCmeDIuGYSE8AYibX4uZqYYUW2hZQ7i31GPShs GCBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=ucWCwvVe2E+kF3/9x6UVXNkpj7I7/le1K1pgNhk52Wk=; b=OEbsQM7gzgOFtDQg/l2hCfRfk/0IQjyDhTz1DGG9B+ChKEOavdzrcbvC1AuWkIVJtK BnWzJS/pOhbbi9LQip7ZD4UEK9WXJTChq6+dVgYMRvAcorE4KslkI/+JCd/TAi/lQuRL EZU988D5AFvXqgn8SyIDaTDyW/Le0uXGKHtSUIR8wAXJuTta/s0C5eO9oKrBOao/B6ri fx7APsB1P6AaA+SjnOoUvz4LIjzrieAUEZvNiwgF/HSwOU4eA17bs1e13Os0aI6aBU+p nfarVdlqjUFryFSl4Vw3vN1h74KCHF+OusdCX8TQ+estVAKER6nqckfJb57iW3hPXBkM rM5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=cf3XUuHj; 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 h3si26167610pgq.33.2019.06.05.10.49.52; Wed, 05 Jun 2019 10:50:09 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=cf3XUuHj; 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 S1726656AbfFERrq (ORCPT + 99 others); Wed, 5 Jun 2019 13:47:46 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35175 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbfFERrq (ORCPT ); Wed, 5 Jun 2019 13:47:46 -0400 Received: by mail-pl1-f195.google.com with SMTP id p1so9954599plo.2 for ; Wed, 05 Jun 2019 10:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ucWCwvVe2E+kF3/9x6UVXNkpj7I7/le1K1pgNhk52Wk=; b=cf3XUuHjKnHDuygJqjMW4Pvrkp+iI7+WKpuoF1XIiqVZ/JZIMrgy/fr1+gwTrAofLn CX6r2s6VgOW6isGJKyiBor2PZnfFJ9+BAp5NdIODNc7nnjGeZ09Mj7MlcmSipAQFLVfj efi8muYh128r8+vJ4Mr5uIb/vSIkMb9/unG5pImxhBdc5q3Ot98iiTMu30NyguBu8HUz KW8dYB3SXzEjR6PRAmSUsJf9kDhvzhHxAE4YYxNmrXZNHNC1S/W7DeZjazTy9MPhGthd PlFQOII6yqr++UZFL2of8Ou9W30d7C884SKj0l16pU68VVzNBaZ1F8hOpyOrwAx+WHOv 5emQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ucWCwvVe2E+kF3/9x6UVXNkpj7I7/le1K1pgNhk52Wk=; b=p8OgfSSIOUQ18QQ9UfwJLHURVCT7cnLf6b2XpIWWjshhUazjQjraHktlIqOFVFGknB ahCIXoA6Rq1YZtu7NyQ+yndfS3nhO39T1m68UwWRzC10dMHkA1kd4WG6cwO1ztO+rPhr rwz7MAJJcVk8hKffyMNAroC9f3P5B+2ilb0Yju9XvLyPhQW7Pqy5JU3hw1uDi4MgA7WA mPuWYpOSaxaXS06owjeWYl0ujdVdnR+1JeIw6L8CbHOJtKvZt4AIYKZSzT05R0FUpkzB dO9H6T9M1mpppNO/4TDdYry8mL4WRNnluTz+vjuMCJhGtP2LQuqtbsEboUAjebbu/Taq /Fgg== X-Gm-Message-State: APjAAAXQv0oVRshi30F/7ln4nr04oicOR3NqZQX7uevba+iCR7yuC/ue ZDXs9aMOnVQtSErM8zk3wlPCFQ== X-Received: by 2002:a17:902:ac82:: with SMTP id h2mr45718057plr.303.1559756865582; Wed, 05 Jun 2019 10:47:45 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:31dd:a2eb:ca:4a50? ([2601:646:c200:1ef2:31dd:a2eb:ca:4a50]) by smtp.gmail.com with ESMTPSA id f2sm17456235pgs.83.2019.06.05.10.47.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 10:47:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] From: Andy Lutomirski X-Mailer: iPhone Mail (16F203) In-Reply-To: <9a9406ba-eda4-e3ec-2100-9f7cf1d5c130@schaufler-ca.com> Date: Wed, 5 Jun 2019 10:47:43 -0700 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-Transfer-Encoding: quoted-printable Message-Id: <15CBE0B8-2797-433B-B9D7-B059FD1B9266@amacapital.net> References: <50c2ea19-6ae8-1f42-97ef-ba5c95e40475@schaufler-ca.com> <155966609977.17449.5624614375035334363.stgit@warthog.procyon.org.uk> <20192.1559724094@warthog.procyon.org.uk> <9a9406ba-eda4-e3ec-2100-9f7cf1d5c130@schaufler-ca.com> To: Casey Schaufler Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jun 5, 2019, at 10:01 AM, Casey Schaufler wrot= e: >=20 >> On 6/5/2019 9:04 AM, Andy Lutomirski wrote: >>> On Wed, Jun 5, 2019 at 7:51 AM Casey Schaufler w= rote: >>>> On 6/5/2019 1:41 AM, David Howells wrote: >>>> Casey Schaufler wrote: >>>>=20 >>>>> 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. In the event delivery case, process A >>>>> does something (e.g. modifies a keyring) that generates an >>>>> event, which is then sent to process B's event buffer. >>>> I think this might be the core sticking point here. It looks like two >>>> different situations: >>>>=20 >>>> (1) A explicitly sends event to B (eg. signalling, sendmsg, etc.) >>>>=20 >>>> (2) A implicitly and unknowingly sends event to B as a side effect of s= ome >>>> other action (eg. B has a watch for the event A did). >>>>=20 >>>> The LSM treats them as the same: that is B must have MAC authorisation t= o send >>>> a message to A. >>> YES! >>>=20 >>> Threat is about what you can do, not what you intend to do. >>>=20 >>> And it would be really great if you put some thought into what >>> a rational model would be for UID based controls, too. >>>=20 >>>> But there are problems with not sending the event: >>>>=20 >>>> (1) B's internal state is then corrupt (or, at least, unknowingly inval= id). >>> Then B is a badly written program. >> Either I'm misunderstanding you or I strongly disagree. >=20 > A program needs to be aware of the conditions under > which it gets event, *including the possibility that > it may not get an event that it's not allowed*. Do you > regularly write programs that go into corrupt states > if an open() fails? Or where read() returns less than > the amount of data you ask for? I do not regularly write programs that handle read() omitting data in the mi= ddle of a TCP stream. I also don=E2=80=99t write programs that wait for pro= cesses to die and need to handle the case where a child is dead, waitid() ca= n see it, but SIGCHLD wasn=E2=80=99t sent because =E2=80=9Csecurity=E2=80=9D= . >=20 >> If B has >> authority to detect a certain action, and A has authority to perform >> that action, then refusing to notify B because B is somehow missing >> some special authorization to be notified by A is nuts. >=20 > You are hand-waving the notion of authority. You are assuming > that if A can read X and B can read X that A can write B. No, read it again please. I=E2=80=99m assuming that if A can *write* X and B= can read X then A can send information to B.