Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp931395imm; Wed, 18 Jul 2018 13:17:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfL7uQwORABs1lKV/l5WSv7AtuwbanLo4MlSJ2MfuMBh9NpWNqATtwbQhuooqdXxkh/9SZa X-Received: by 2002:a63:1f20:: with SMTP id f32-v6mr6882591pgf.84.1531945047040; Wed, 18 Jul 2018 13:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531945047; cv=none; d=google.com; s=arc-20160816; b=d7ARvtDEaQbAaZ+icYcxvZbNPrafXexJnMPwC4l4OAmFBerlbedU1xZzwj6sdOjJO1 u4JPTN0EFhJtx+Ti5L3iFT2m0he6pUHNfYM7KADl+q7ppKkRC7a3WTs2gIAAhbq+eck0 /zmp09C52oidCK98/Xzu5zU8fQts26APgeo0hG2tQ6Cap2TO7kh97BtSKauD7tY+CyOZ iLOV2fIFeIbllEQ8Nw4/B4s8qdanzeGZoAaoXlWaNTvRRtmSv/lFXy4lA20fwrLo7dtZ IJ69ogk2vfqPViEP5akPUTCDNOHaOACAkQdwtzrV+vhwup7u930+GGX7bR9m6sG5fPS7 y+5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=+ANWrDzj2p3jtPHaB9Fb8yXWSpkVA6HPFzqNTSAn/eA=; b=PxjouqkkbfqsO9cJqxtqjm2ZCClPMeQCDwUUCJkKFXIaIvlf+KnmBYi7/GRQOTsXO2 gf3OGSblHEVXBaj8M6jcPJ5yXIooJtxxjcx2J5rm5BXbodVdHTzL8ridF9BdzFmQFrYD T1yoq6/ll6NgVxsYfBG6sqUJTPHwnq9Jys89nTrcm3tpMMK9mDvA/XOJgMtBtwHqiNG5 NPnGPgTx1sLDBKG/bv9Llxcu+KQ7R35mfSolPKV0UguFAA71WEyE8qhW2OuwArUhKagX yeQauSAimyHrqnuRzp29sAm9wpullxXw8S3nha8RQ9LHpYQTYtPTbZ4NksHbmrzRnHP0 tM+g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si4080758pfj.311.2018.07.18.13.17.12; Wed, 18 Jul 2018 13:17:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730885AbeGRUyw (ORCPT + 99 others); Wed, 18 Jul 2018 16:54:52 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:40010 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730839AbeGRUyv (ORCPT ); Wed, 18 Jul 2018 16:54:51 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1ffsr0-0004Yw-Dx; Wed, 18 Jul 2018 20:15:18 +0000 Date: Wed, 18 Jul 2018 21:15:18 +0100 From: Al Viro To: Linus Torvalds Cc: Miklos Szeredi , Stephen Rothwell , linux-fsdevel , Linux Kernel Mailing List Subject: Re: [RFC] call_with_creds() Message-ID: <20180718201518.GX30522@ZenIV.linux.org.uk> References: <20180718132955.2bf185b7@canb.auug.org.au> <20180718124340.GS30522@ZenIV.linux.org.uk> <20180718181252.GU30522@ZenIV.linux.org.uk> <20180718194637.GV30522@ZenIV.linux.org.uk> <20180718200411.GW30522@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718200411.GW30522@ZenIV.linux.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 09:04:11PM +0100, Al Viro wrote: > On Wed, Jul 18, 2018 at 12:53:48PM -0700, Linus Torvalds wrote: > > On Wed, Jul 18, 2018 at 12:46 PM Al Viro wrote: > > > > > > Huh? Nevermind ->write(), what about open()? > > > > What about open? > > > > At open time, file->f_cred is the same as current_cred(). > > int cachefiles_write_page(struct fscache_storage *op, struct page *page) > { > ... > file = dentry_open(&path, O_RDWR | O_LARGEFILE, cache->cache_cred); > > > int ecryptfs_privileged_open(struct file **lower_file, > struct dentry *lower_dentry, > struct vfsmount *lower_mnt, > const struct cred *cred) > ... > (*lower_file) = dentry_open(&req.path, flags, cred); Actually, scratch that one - in this case it is current_cred() (whether that's the right value or not). cachefile_write_page() case is for real, AFAICS.