Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5891426ybi; Tue, 4 Jun 2019 14:14:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0I7uUN2a/MAdf2tt8GvU//yqiTz2+rseBQnNDaKixvkN8Dix9mB0H4j5bVmawyVw7VuKe X-Received: by 2002:a17:902:2a68:: with SMTP id i95mr39729511plb.167.1559682897935; Tue, 04 Jun 2019 14:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559682897; cv=none; d=google.com; s=arc-20160816; b=zENZiBIwHX+jF+HpV4UOgm/Sa5gvk/NcMvwh7tZwcjfGjiAX9X+i96ARn/PYiwVcBO 89Jge3CRL1oXxGOP1O4IkprWb22+U56vT96I3k0J/8xqJ7LEAxcW1RoKghW6QBQ2LpEz VxrZSPKv+o+8F1+OSLOrm23yRvheES/74XMqHW80EvkgbGskE0qkbiwS461S1hh+Cv82 UyiyjM1vfg8wVDTnH71EdxfEShiB5VxWdls+JTMsQgVZW901bPsk6a+BQjJjcgpn7gUd 4R6Us+A048VWxil9CoKoM2eO/BvR6ourhSAihmuALqpYE8vRuH8C2iP/2FgBeixLX3Tl Y+Uw== 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=rIePoQB7SfoXEtKT+Ykbw4tlwyh2+weCxD1TWpXWU/c=; b=O2EpJ6bUQnjQz4YqSsKC11vc4B9Q/o/XYLI9GOpqc5RiNvTTZ5Sl5yhseOgAsf4AEI Hl7sEc8iGMTt5u/Jm2ja+bak8e8HnRDWtOU+awfF6AL6PN2RXtJ9cB7oqL06fceXm/8C E96gu+1BGQlsLFj30ncIpAWLvc1pzOvccix19x1TCPORcqe06dpD2Z0VcZFxkSM/snJ4 dJRV+qLMiRimMB+vSBKYtDAaOzD43z8Wy0r9sfEmO8CrPixVqj46EwCZ4ZiD/AW8IKOl beYniPSFBZx4/rlb9QK1v5ik96Jg5uyaCotUPfihtZPjqAb5fKBeq+P/KndHCuvvZtB9 EGXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=bUNqTZBs; 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 r11si23519205plo.360.2019.06.04.14.14.40; Tue, 04 Jun 2019 14: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=bUNqTZBs; 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 S1726535AbfFDVLx (ORCPT + 99 others); Tue, 4 Jun 2019 17:11:53 -0400 Received: from sonic309-27.consmr.mail.gq1.yahoo.com ([98.137.65.153]:44291 "EHLO sonic309-27.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726033AbfFDVLw (ORCPT ); Tue, 4 Jun 2019 17:11:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1559682711; bh=rIePoQB7SfoXEtKT+Ykbw4tlwyh2+weCxD1TWpXWU/c=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=bUNqTZBshgF6lT2ZVGKEVPunsAMpq5+svvqycwgdRizvoFNDcMTjzq8O8BzRgWTy20oKaeKLCbOGDHNjwrLy80H+r7EDQ+kRgCWNkA/iFAAzZ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3E yRk3D6HhnHjAcVh_X6buY5Udc91GZn0dL2eU90VGiKSMN5.mDSJVPgiiOXdR_rMyZQivtswiBAWV ScBCv_6jmYkbezFq8f2VW80FsSmcaGkUJhHH7iiLDT_rTxCxuAvLbll_Q_zPyG0TEL1r.zi8fyV8 oAYzKtufldOj3yhVo5buNU.41QaetVG6c8qt40p2Y2Z7Z1oz2sU.d2zzkRwCkU11c9_JqASVLjEL tYIgIw7OJYeOXJl5DhXD0OYP4m0oumbkf_aVhQtjZm4UuouzDD7OQIeYRvOEdLuYtu7nY9f90I1t 8TI4SYJCtOiQS3W6JrGbxKFgIqCtsZcIyJFqPXFGuhyvljYzqFs.UntcTp519S92VYfqPLgv6rRU PdoMhX.eSz_aMuF8d.TsZgLwI72fG1cycruTmx2QMYBHSabcqmDGXRQeMGyihDgNNAR.cuS4CxDM ndMgn6AN2SGDbBOIE5pAI3m7_PFE8f7sUEQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Tue, 4 Jun 2019 21:11:51 +0000 Received: from c-73-223-4-185.hsd1.ca.comcast.net (EHLO [192.168.0.103]) ([73.223.4.185]) by smtp419.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID e29402de8ce9ac532fdb1db0d6288519; Tue, 04 Jun 2019 21:11:46 +0000 (UTC) Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] To: David Howells , Andy Lutomirski Cc: 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> <1207.1559680778@warthog.procyon.org.uk> From: Casey Schaufler Openpgp: preference=signencrypt Autocrypt: addr=casey@schaufler-ca.com; keydata= mQINBFzV9HABEAC/mmv3jeJyF7lR7QhILYg1+PeBLIMZv7KCzBSc/4ZZipoWdmr77Lel/RxQ 1PrNx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QO4ikcef/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: <3ca991d1-4056-c45b-dbae-9976fb5d81e0@schaufler-ca.com> Date: Tue, 4 Jun 2019 14:11:45 -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: <1207.1559680778@warthog.procyon.org.uk> 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 1:39 PM, David Howells wrote: > Andy Lutomirski wrote: > >>> 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? > Casey responded to you. It's one of his requirements. Process A takes an action. As a result of that action, an event is written to Process B's event buffer. This isn't a covert channel, it's a direct access, just like sending a signal. Process A is the subject and the event buffer, which is part of Process B, is the object. > I'm not sure of the need, and I particularly don't like trying to make > indirect destruction events (mount destruction keyed on fput, for insta= nce) > carry the creds of the triggerer. Indeed, the trigger can come from al= l sorts > of places - including af_unix queue destruction, someone poking around = in > procfs, a variety of processes fputting simultaneously. Only one of th= em can > win, and the LSM needs to handle *all* the possibilities. Yes, it's a hairy problem. It was a significant factor in the demise of kdbus. > However, the LSMs (or at least SELinux) ignore f_cred and use current_c= red() > when checking permissions. See selinux_revalidate_file_permission() fo= r > example - it uses current_cred() not file->f_cred to re-evaluate the pe= rms, > and the fd might be shared between a number of processes with different= creds. > >> This seems like the wrong approach. If an LSM wants to prevent covert= >> communication from, say, mount actions, then it shouldn't allow the >> watch to be set up in the first place. > Yeah, I can agree to that. Casey? Back to your earlier point, you don't know where the event is coming from when you create the event watch. If you enforce a watch time, what are you going to check? Isn't this going to be considered too restrictive?