Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1027822imm; Thu, 4 Oct 2018 07:10:46 -0700 (PDT) X-Google-Smtp-Source: ACcGV60FAlT2MuYdVD3snxwvrAeSFQd5GILjA9NWI6GAd2UCWlUdNEboj0rIS9pva3pAq0oVi6Pw X-Received: by 2002:a63:5558:: with SMTP id f24-v6mr6058739pgm.37.1538662246689; Thu, 04 Oct 2018 07:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538662246; cv=none; d=google.com; s=arc-20160816; b=OYRH1EGENUFd6fN3ESGnSD2srhuBJS/W7TCeRgQOWYi+f7uZOEGSxRIopUr5m+//hC IpFmh+nqU4uOFF0SHJ+r32RCa/ZxxIU1NGBITchzQOREWpWGJ0Ym/M4ToJNkRr3ayFje n6SFZkYnIxTDb7GBIwIynGeHANpzfjuY5XDthzEycOpgdociqm1X5BxSlk+N+01bfpHO y+ClrcnB6qigWG6oNRUHuEiVOl8cYT4xp2TAdCHN9wLOVLkG7mzo7Z+83LuOis4KFYr3 gkuLLL0U5ZHzTGkToLAO3cSR6LEhnHHcjVJmcm3tRY7+gDaW0G7y8MgtgxlG6kw9VLXR 1Izw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-id:mime-version :subject:cc:to:references:in-reply-to:from:organization; bh=uEzZ3bCFzUIoVRqOCbaO6jXD7U5YtYuKMpBaiWTKO68=; b=F4+33HSSJLZ+p6wf82dt+A7nip9f2pCmUjHf89p7/YqKP/3sW5BbxP6jwR8dAxgApp Orfoc4wnX9tqYUrtUizP8M/XMb3jZZvzK1de12tfwJ/io6/1SGNYMV8S7bYUuNDfea4X uMy9O87QKkEFF14EZL3zX0CSSGUzg46JusxnONjDDYbOCnMJFie30uYEVdBPmWhRqRRP MRDTfJI2Gm1kNrlEMlXQa0L2YRmKqpbVMwUG+lz9UoQjAd0mPTqp1aU+we4Gi/ZgGkZ/ YCP7RaN+PnRb7aq56JYAyEhavwbz+3d3sAv1OrXx7IGnTMLPXTtn8ra4TFejkNUY3D01 4plA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si5631925plf.411.2018.10.04.07.10.31; Thu, 04 Oct 2018 07:10:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbeJDVDv (ORCPT + 99 others); Thu, 4 Oct 2018 17:03:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49990 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727355AbeJDVDv (ORCPT ); Thu, 4 Oct 2018 17:03:51 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6F5A512F8E4; Thu, 4 Oct 2018 14:10:21 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-149.rdu2.redhat.com [10.10.120.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 622B41084288; Thu, 4 Oct 2018 14:10:17 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <153861496327.30373.10501882399296347125.stgit@noble> References: <153861496327.30373.10501882399296347125.stgit@noble> <153861471803.30373.6184444014227748848.stgit@noble> To: NeilBrown Cc: dhowells@redhat.com, "J. Bruce Fields" , Anna Schumaker , Alexander Viro , Trond Myklebust , Jan Harkes , linux-nfs@vger.kernel.org, Miklos Szeredi , Jeff Layton , linux-kernel@vger.kernel.org, linux-afs@lists.infradead.org, coda@cs.cmu.edu, linux-fsdevel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 1/3] VFS: introduce MAY_ACT_AS_OWNER MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28762.1538662213.1@warthog.procyon.org.uk> Date: Thu, 04 Oct 2018 15:10:13 +0100 Message-ID: <28763.1538662213@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 04 Oct 2018 14:10:22 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NeilBrown wrote: > diff --git a/fs/afs/security.c b/fs/afs/security.c > index 81dfedb7879f..ac2e39de8bff 100644 > --- a/fs/afs/security.c > +++ b/fs/afs/security.c > @@ -349,6 +349,16 @@ int afs_permission(struct inode *inode, int mask) > if (mask & MAY_NOT_BLOCK) > return -ECHILD; > > + /* Short-circuit for owner */ > + if (mask & MAY_ACT_AS_OWNER) { > + if (inode_owner_or_capable(inode)) You don't know that inode->i_uid in meaningful. You may have noticed that afs_permission() ignores i_uid and i_gid entirely. It queries the server (if this information is not otherwise cached) to ask what permits the user is granted - where the user identity is defined by the key returned from afs_request_key()[*]. So, NAK for the afs piece. David [*] If there's no appropriate key, anonymous permits will be used.