Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp8491608ybi; Thu, 6 Jun 2019 13:18:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYwWj/nlq+v0PSPzamoNKWy/3xZWISoxsibGUGycHNI6no38SaGjmgKK1U8D9oCqZgR0n9 X-Received: by 2002:a17:902:8c82:: with SMTP id t2mr51945730plo.256.1559852304341; Thu, 06 Jun 2019 13:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559852304; cv=none; d=google.com; s=arc-20160816; b=KJKg4Xubxj08Zrd+FexCZUb4cTczFE5zXCob9hF2VkbD6f0IAAMb8dUyTGjRf2qwao Y4QLJ/nRm4kyXZOaR0hvhQL0uU5ipLY/ZiNUubznX/CIEZhitKa4mBNQhdN2u7KeoDyN dW4e1iol7ojKuC+7I+1PrPCBPKeMaiH21xTdUelxxBM8sJ+OOEd+2NEBBWaIVBvKlO7l FKY+tDaVmbdXDrepB3tsj7jUYi30/XgJKjMR+ZVWjHnKIRyf5WXcBid+0yF5gTVPN0BF JNCopBBA5mWOvB01d9B3wLks0/+jpCTM4fsDWEt4AQqHDgp24G1h8CLM86W5HG9YZlR9 fmSw== 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=KPinPwVYIStvQmTsZ8fVXryXE8chlEpKVcNaTLUqBkk=; b=RkGNqu/bEhyWu+BmxoJpJQ8gSa0Ok56UdBR5s3rSV/QOpNCZgqU6EWDVVvelMLKk+W mn83EIZKqlDxFiywk8qXH2ISHKuP86/doVRLOkGh8mTr2j7914doK39UMe3gURM37Evx OTEX0bScNXEs7NE04YtAfQtoSBkdyMbfrWhkkcmxZp9xnGV6hZlbVHV8EP68Ca2rm6qi nW9dAClS64OKJE8dwjzeDKEbey0XVR2Nur8I7vi8xdPSSdc6xGrxneYELQs28TaQ1bvP Hog+6oCyVu43adi1rf6qu86sDIy4RyDaaewFgN6aRqZy5Znb7r8rPzZSd6wrNZcYhLfX Ecjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=ptIZ7O3D; 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 az6si65585plb.65.2019.06.06.13.18.08; Thu, 06 Jun 2019 13:18:24 -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=ptIZ7O3D; 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 S1728807AbfFFTJU (ORCPT + 99 others); Thu, 6 Jun 2019 15:09:20 -0400 Received: from sonic309-27.consmr.mail.gq1.yahoo.com ([98.137.65.153]:38297 "EHLO sonic309-27.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbfFFTJT (ORCPT ); Thu, 6 Jun 2019 15:09:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1559848158; bh=KPinPwVYIStvQmTsZ8fVXryXE8chlEpKVcNaTLUqBkk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=ptIZ7O3DcCuP6w96YCf4TBwwelJOiWXKMueXaWyXXS5Hq4SYnr+yqA27IH0WbMQoPfbRbUAYQs6alr5jVMqntnHFO0+yYMLbtHu07P99vBJBR/ZbfP/q9g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TB9ulLUSLa_.ztDkP6Lszm3_ihfLVrD8kp.q8Od.xl99cvIM2MyLj2GDDPdWv_lXGCH 1eBPljjZGzXWQHP4VxUcrDfDX2V6pfgGfXySasOB9ZYxN0M2KcpH.yy.CS31YvIcy1_4FPMcxy9J LIOJRrDOLIMcSP_55W0mMNvXFTbrF7gWQQ01eYcm.l2.TSh9KZOT5l2OAo_VgT2N2btyTh1sX.Bd _7gEkXyp6CFX9W_bT5PeCNVkjUOW2O54CFrvVfd0LW_Gu2wiVocWlWw._qFwB9Iv4.kTi_Fbu3Hn .j9mF9JRzytmZ91owEN15vId6q6qPWt7sUkDLojxv16KscbX6Qr7R51Ii6bX1trZZJi2uiRlXjs0 G1i12exe9mz4FcI3AZza6l2YZfzpacHYfYwUmSjk04_fOIX.Z3QBy36o0qKVPGoKEC1sWVf5Uq8p AVaeu2iyQUIXNvUVMcQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Thu, 6 Jun 2019 19:09:18 +0000 Received: from c-73-223-4-185.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([73.223.4.185]) by smtp416.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID b9532036bed4f2064fc104d314331dec; Thu, 06 Jun 2019 19:09:13 +0000 (UTC) Subject: Re: [PATCH 01/10] security: Override creds in __fput() with last fputter's creds [ver #3] To: Andy Lutomirski , David Howells Cc: Al Viro , raven@themaw.net, Linux FS Devel , Linux API , linux-block@vger.kernel.org, keyrings@vger.kernel.org, LSM List , LKML , Jann Horn References: <155981411940.17513.7137844619951358374.stgit@warthog.procyon.org.uk> <155981413016.17513.10540579988392555403.stgit@warthog.procyon.org.uk> <176F8189-3BE9-4B8C-A4D5-8915436338FB@amacapital.net> <11031.1559833574@warthog.procyon.org.uk> From: Casey Schaufler Openpgp: preference=signencrypt Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+P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BokrFH8kqnEQ9W2QgrjDX3et2WwZFLOoOCItWxT0/1QO4ikcef/E7HXQf/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: Date: Thu, 6 Jun 2019 12:09:06 -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/6/2019 10:18 AM, Andy Lutomirski wrote: > On Thu, Jun 6, 2019 at 8:06 AM David Howells wrot= e: >> Andy Lutomirski wrote: >> >>>> So that the LSM can see the credentials of the last process to do an= fput() >>>> on a file object when the file object is being dismantled, do the fo= llowing >>>> steps: >>>> >>> I still maintain that this is a giant design error. >> Yes, I know. This was primarily a post so that Greg could play with t= he USB >> notifications stuff I added. The LSM support isn't resolved and is un= changed. >> >>> Can someone at least come up with a single valid use case that isn't >>> entirely full of bugs? >> "Entirely full of bugs"? > I can say "hey, I have this policy that the person who triggered an > event needs such-and-such permission, otherwise the event gets > suppressed". But this isn't a full use case, and it's buggy. It's > not a full use case because I haven't specified what my actual goal is > and why this particular policy achieves my goals. And it's entirely > full of bugs because, as this patch so nicely illustrates, it's not > well defined who triggered the event. For example, if I exec a setuid > process, who triggers the close? What if I send the fd to systemd > over a socket and immediately close my copy before systemd gets (and > ignores) the message? Or if I send it to Wayland, or to any other > process? > > A file is closed when everyone is done with it. Trying to figure out > who the last intentional user of the file was seems little better than > random guessing. Defining a security policy based on it seems like a > poor idea. > >> How would you propose I deal with Casey's requirement? I'm getting th= e >> feeling you're going to nak it if I try to fulfil that and he's going = to nak >> it if I don't. >> > Casey, I think you need to state your requirement in a way that's well > defined, and I think you need to make a compelling case that your > requirement is indeed worth dictating the design of parts of the > kernel outside LSM. Err, no, I don't believe so. There's a whole lot more going on in this discussion than just what's going on within the LSMs. Using examples from the LSMs makes it easier, because their policies are better defined than the "legacy" policies are. The most important part of the discussion is about ensuring that the event mechanism doesn't circumvent the legacy policies. Yes, I understand that you don't know what that means, or has to do with anything.