Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5877697ybi; Tue, 4 Jun 2019 13:59:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcafxwDHHHew97vVb9YYKOfAEU33thoChWRalcOCFAY/gGiakFobCH7JrN9mNPoeJhzhOd X-Received: by 2002:a63:4621:: with SMTP id t33mr733083pga.246.1559681974612; Tue, 04 Jun 2019 13:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559681974; cv=none; d=google.com; s=arc-20160816; b=AjwseyHK6m0dOajKu6XMNaic4yeKWvsuEfzeOnqOlsZWg5qNJfeCYbvZu5kQc8YP5o ppP5e0olfxC7/e1Fx6zJeJEmdPc9JanklQJ7uNkKhdy+eHQJNKqxcrG+I/PSIPz8ts1N Sqw2paYqkvnja/GtoTRMv+TVMC1JRlbIbe75EbZQek1Ljg/Qp7ANk2amtp3aW//1ZiQT 7VYVIJGtXt4QKGoUovm0Lk0Q7xkWysq+vbrqWFDsYgf9Rn4PHIShMyfI+YJJiCWIs20D XncOafdtaCf8i4tYa8YarJbb41gt2eo4LAdZfrkMCJPGacvlrnV4UI8s5XPk3qBk8GnK 1a7Q== 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=IWL5XmJS5OIafX//51egQnBQ+4+Ukf+ifWhA263rKYU=; b=G5JsI0+t/h7GbN1MmSZGqUCO0E95JyWhd9L0V+taDMnwp7C3wHhNky5G+hxpfg+/dP zXUxqoo79lR2pFMGNoR4PzI6JLCUcLJETkH5ZEs+VDfZHv2opnXHsoZ0ack+Fyej+xL6 yvv73jC6KPr00FPrLN0NozUa42pzgiRjUugFNHTmNqkLUjblub31bF1oKS+urYBEgxrh AxacDUJCnRYo/LI4aTF+5BZ6pwi/qoD/ZAArlcUVC2nlhWrXdxiP/tWvqJ9WMa4jHNlI VeqxQ2YTW4fQSE4PfLRe0n8y4kfyktb23JSZzZ7zw5vyq6zL/2ECfBZlYzu1L65l6W6m Gi1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I4PRguwk; 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 q17si23133838pll.285.2019.06.04.13.59.18; Tue, 04 Jun 2019 13:59:34 -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=I4PRguwk; 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 S1726399AbfFDU5u (ORCPT + 99 others); Tue, 4 Jun 2019 16:57:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:44190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbfFDU5n (ORCPT ); Tue, 4 Jun 2019 16:57:43 -0400 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 9382D2085A for ; Tue, 4 Jun 2019 20:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559681862; bh=ihQrR3672ZM/DzWjZDVj/EkCVxnHXupxxQEbDR/4vAg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=I4PRguwk4bMuMypdm5AOXXn53k/m+L5N9pyKwSfTNHLewnh8M65uGMG7NNR3Ebc8l rsRnH3DUUzV1SO4+TidtsVDH9S4H4Orx7UfDX0ta38L+l5LFNUqPzgkVOGyqiElmZe nHeIlBvnyw6Sot3eJ4IIqxcrsiVBsK6rjKdIv0AM= Received: by mail-wm1-f42.google.com with SMTP id f10so144564wmb.1 for ; Tue, 04 Jun 2019 13:57:42 -0700 (PDT) X-Gm-Message-State: APjAAAWH66ne9WVxMUyhrxJkeIzBPi/l8Cb0juCnRtDVGVS/gpTo9ATi aST7xm2XWpfe8P2deQghTN/89oO3praFqKNo5mkMOw== X-Received: by 2002:a7b:c450:: with SMTP id l16mr19833827wmi.0.1559681861171; Tue, 04 Jun 2019 13:57:41 -0700 (PDT) MIME-Version: 1.0 References: <155966609977.17449.5624614375035334363.stgit@warthog.procyon.org.uk> <1207.1559680778@warthog.procyon.org.uk> In-Reply-To: <1207.1559680778@warthog.procyon.org.uk> From: Andy Lutomirski Date: Tue, 4 Jun 2019 13:57:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 0/8] Mount, FS, Block and Keyrings notifications [ver #2] To: David Howells Cc: Andy Lutomirski , Al Viro , Casey Schaufler , 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: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. > It being a "requirement" doesn't make it okay. > However, the LSMs (or at least SELinux) ignore f_cred and use current_cred() > when checking permissions. See selinux_revalidate_file_permission() for > example - it uses current_cred() not file->f_cred to re-evaluate the perms, > and the fd might be shared between a number of processes with different creds. That's a bug. It's arguably a rather severe bug. If I ever get around to writing the patch I keep thinking of that will warn if we use creds from invalid contexts, it will warn. Let's please not repeat this.