Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7103312ybi; Wed, 5 Jun 2019 11:14:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDzp8PQ8qtY7egUBbkvceUfdorKavQRZUYaooA8vDOyfBeafXSjlHRTOYuv5EeOz7oN3oo X-Received: by 2002:a63:8dc4:: with SMTP id z187mr6415462pgd.337.1559758497678; Wed, 05 Jun 2019 11:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559758497; cv=none; d=google.com; s=arc-20160816; b=aTqYemo/IEiTkdnZPeZXmTDlRLXVOHZTxvr0s9885Gygi4b88sZPYFptNSZym7Q6F4 4efVtDWgW+6IL/Z4PbYnXjEOAlbaxVev78vTEGAcvnjTP/4TpC/g2GI9y2xpSIwyaXDi SHBtkMlpZmvMawujwJjNzbfXPUctFwxS7S7kyuKpziTxKWQGe3iOz6Q4jUxFrPKA6HgM aimdpVL6BrItM3bVAlCcqIYtIXdLQSIXQRj8EKfx5AWIQ8/yUnz4d9luDY9qpLpPl8x3 8lQRpxfZDqF50M84WHODlnJmGrp12sxZrPCW9h0LHwMiN8aFd3uPyLBmkDYhcrm7XM6a IIjg== 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=1Jvc/kSniiBr5+XEKGKZKBXDs69qYfCMxICYBNY2uIc=; b=Lrzo/dXxsA3YfNxIUTAp4TcSH1eAcyuXUlbVvl/Br4bp5nA5b27Qfg2ng7venYR+PY YEyOiQ6F1EYFTk8yw/av20WaU+hcA/SkUKbKHmmGSPqYAjYuFpnvUSgHwgcDBxcsLiWX CmlvZ+jma5LQS6yK/9CgFrFwllyHFcGs40fd4mCVKz5UjXy1JtFQq47yXbhbb7u95aE1 3lWEKi5/8dtOWNFryK98jSvRaAjWyuTcQxMxSGdtPs3u13EzG1pxrv/x/I966nGmuX6G cbO5Kyen9UKH8pWWr3ZR16KYd0sX0WcUQaOq0wY7PXTD8pdFBuxRB8AjsnpQMJkSlVqJ b28Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=gKVFjr5O; 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 be3si27434575plb.127.2019.06.05.11.14.40; Wed, 05 Jun 2019 11:14:57 -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=gKVFjr5O; 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 S1726655AbfFESM2 (ORCPT + 99 others); Wed, 5 Jun 2019 14:12:28 -0400 Received: from sonic317-38.consmr.mail.ne1.yahoo.com ([66.163.184.49]:38247 "EHLO sonic317-38.consmr.mail.ne1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbfFESM1 (ORCPT ); Wed, 5 Jun 2019 14:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1559758345; bh=1Jvc/kSniiBr5+XEKGKZKBXDs69qYfCMxICYBNY2uIc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=gKVFjr5OTjaU2XiluV1y1NFKUIbrXhQbucLNd6iPDQL0EKxss7PbPtDdtXOyRoQvSUk6yBHcXtnPPE9zmqGIvU58DxHaH4xFP57uOdXTKX3J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c QM3Xb41TqtKurcTQj26r.zkinIztbE6Xc4vuqhJC4c62t3sNGEm3J4t5cv.rJPoDvjwKDTKbR7Vg 0Esqc8kllmn6gPyEa9cvmBtk_ct7LYPvnmX3lGpY5YRE6iXoHtZnBBmklUOitkkJ5XpRiwY8.XQ6 P.yRJyBDjt1vguSpZ8DEKfSVR3CnOHzy_Q5pFHX4TmGRTR1OwQ6BA8LHAi0_CRxVzsZuSyKfmzRH _gHzW5oE9C_vusDsp6.U3Yl5tSIVAOiqElpeuTAZ7NextmJo7wUHzc8LBpXVAc9P2dOvI7f0by0g mr0NCuKqR9zLKfzPuidlge4HuH8Vz8YcE2r0AReokFhoYXhLHQV1wQPdVGX7qc5qu24vEcRz6YdP u84_STiMEADuMgV.Vv90vYkevTVa7sz8V2PY5z6cWvFra9e8IbTMFDUHlMXjQPvjd5WNYbB5_PLg MDoRmOUjqqfIZGOKhL4AmXMNX2ujOeNtpt80wGR5Q Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Wed, 5 Jun 2019 18:12:25 +0000 Received: from c-73-223-4-185.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([73.223.4.185]) by smtp416.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 705459f08fa8316e34f1cab0e1bf46d0; Wed, 05 Jun 2019 18:12:21 +0000 (UTC) Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] To: Andy Lutomirski 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 , casey@schaufler-ca.com 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> <15CBE0B8-2797-433B-B9D7-B059FD1B9266@amacapital.net> From: Casey Schaufler Openpgp: preference=signencrypt Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx0UaM5r6Hj9lJmJ9eg4s/TUBSP67mTx+tsZ1RhG78/WFf9aBe8MSXxY5cu7IUwo0J/CG vdSqACKyYPV5eoTJmnMxalu8/oVUHyPnKF3eMGgE0mKOFBUMsb2pLS/enE4QyxhcZ26jeeS6 3BaqDl1aTXGowM5BHyn7s9LEU38x/y2ffdqBjd3au2YOlvZ+XUkzoclSVfSR29bomZVVyhMB h1jTmX4Ac9QjpwsxihT8KNGvOM5CeCjQyWcW/g8LfWTzOVF9lzbx6IfEZDDoDem4+ZiPsAXC SWKBKil3npdbgb8MARPes2DpuhVm8yfkJEQQmuLYv8GPiJbwHQVLZGQAPBZSAc7IidD2zbf9 XAw1/SJGe1poxOMfuSBsfKxv9ba2i8hUR+PH7gWwkMQaQ97B1yXYxVEkpG8Y4MfE5Vd3bjJU kvQ/tOBUCw5zwyIRC9+7zr1zYi/3hk+OG8OryZ5kpILBNCo+aePeAJ44znrySarUqS69tuXd a3lMPHUJJpUpIwSKQ5UuYYkWlWwENEWSefpakFAIwY4YIBkzoJ/t+XJHE1HTaJnRk6SWpeDf CreF3+LouP4njyeLEjVIMzaEpwROsw++BX5i5vTXJB+4UApTAQARAQABtChDYXNleSBTY2hh dWZsZXIgPGNhc2V5QHNjaGF1Zmxlci1jYS5jb20+iQJUBBMBCAA+FiEEC+9tH1YyUwIQzUIe OKUVfIxDyBEFAlzV9HACGwMFCRLMAwAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQOKUV fIxDyBG6ag/6AiRl8yof47YOEVHlrmewbpnlBTaYNfJ5cZflNRKRX6t4bp1B2YV1whlDTpiL vNOwFkh+ZE0eI5M4x8Gw2Oiok+4Q5liA9PHTozQYF+Ia+qdL5EehfbLG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 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <15CBE0B8-2797-433B-B9D7-B059FD1B9266@amacapital.net> 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/5/2019 10:47 AM, Andy Lutomirski wrote: >> On Jun 5, 2019, at 10:01 AM, Casey Schaufler = wrote: >> >>> On 6/5/2019 9:04 AM, Andy Lutomirski wrote: >>>> On Wed, Jun 5, 2019 at 7:51 AM Casey Schaufler wrote: >>>>> On 6/5/2019 1:41 AM, David Howells wrote: >>>>> Casey Schaufler wrote: >>>>> >>>>>> 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: >>>>> >>>>> (1) A explicitly sends event to B (eg. signalling, sendmsg, etc.) >>>>> >>>>> (2) A implicitly and unknowingly sends event to B as a side effect = of some >>>>> other action (eg. B has a watch for the event A did). >>>>> >>>>> The LSM treats them as the same: that is B must have MAC authorisat= ion to send >>>>> a message to A. >>>> YES! >>>> >>>> Threat is about what you can do, not what you intend to do. >>>> >>>> And it would be really great if you put some thought into what >>>> a rational model would be for UID based controls, too. >>>> >>>>> But there are problems with not sending the event: >>>>> >>>>> (1) B's internal state is then corrupt (or, at least, unknowingly i= nvalid). >>>> Then B is a badly written program. >>> Either I'm misunderstanding you or I strongly disagree. >> 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 t= he middle of a TCP stream. I also don=E2=80=99t write programs that wait= for processes to die and need to handle the case where a child is dead, = waitid() can see it, but SIGCHLD wasn=E2=80=99t sent because =E2=80=9Csec= urity=E2=80=9D. > >>> 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. >> 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. That is *not* a valid assumption: A can write to /dev/null. B can read from /dev/null. Does not imply B can read what A wrote. Does not imply A can send a signal to B. A can send a UDP datagram to port 3343 B can is bound to port 3343 Does not imply the packet will be delivered =C2=A0