From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933206AbdBVPSB convert rfc822-to-8bit (ORCPT ); Wed, 22 Feb 2017 10:18:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55118 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932988AbdBVPR6 (ORCPT ); Wed, 22 Feb 2017 10:17:58 -0500 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: <148777059228.7183.7698026974948697349.stgit@warthog.procyon.org.uk> References: <148777059228.7183.7698026974948697349.stgit@warthog.procyon.org.uk> Cc: dhowells@redhat.com, viro@ZenIV.linux.org.uk, linux-kernel@vger.kernel.org, Seth Forshee , "Eric W. Biederman" , linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org Subject: Re: [PATCH] vfs: Partially revert addition of cred override in follow_automount() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21584.1487776675.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 22 Feb 2017 15:17:55 +0000 Message-ID: <21585.1487776675@warthog.procyon.org.uk> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 22 Feb 2017 15:17:58 +0000 (UTC) To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Howells wrote: > The following commit: > > commit aeaa4a79ff6a5ed912b7362f206cf8576fca538b > Author: Eric W. Biederman > Date: Sat Jul 23 11:20:44 2016 -0500 > fs: Call d_automount with the filesystems creds > > brackets the call to ->d_automount() with override_creds() and > revert_creds(), setting the initial credentials for use whilst > automounting. > > This, however, breaks AFS as it's no longer able to access the calling > process's keyrings to read the destination on a mountpoint. This has gone > unnoticed till now because, to this point, stat'ing or validating the inode > caused the body of the mountpoint to be read into the pagecache (so that we > could determine whether what we were looking at was really a mountpoint). > > However, the page containing the mountpoint destination is merely *cached* > and not pinned. If it gets discarded and we try to read it in d_automount, > we may fail because we have no authentication tokens available. > > So, for the moment, revert the addition of override_creds() and > revert_creds() and their variable. > > Fixes: aeaa4a79ff6a ("fs: Call d_automount with the filesystems creds") > Signed-off-by: David Howells > cc: Seth Forshee > cc: "Eric W. Biederman" > cc: Al Viro This is also resolved by: https://git.kernel.org/cgit/linux/kernel/git/ebiederm/user-namespace.git/commit/?h=for-next&id=93faccbbfa958a9668d3ab4e30f38dd205cee8d8 David