From patchwork Thu Mar 2 17:06:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 9601169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1AF0560522 for ; Thu, 2 Mar 2017 17:26:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B5DC283EE for ; Thu, 2 Mar 2017 17:26:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F40342858C; Thu, 2 Mar 2017 17:26:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D57728526 for ; Thu, 2 Mar 2017 17:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753146AbdCBR0i (ORCPT ); Thu, 2 Mar 2017 12:26:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55586 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752680AbdCBR0e (ORCPT ); Thu, 2 Mar 2017 12:26:34 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3034C057FA4; Thu, 2 Mar 2017 17:06:58 +0000 (UTC) Received: from horse.redhat.com ([10.18.25.140]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v22H6vpf029927; Thu, 2 Mar 2017 12:06:57 -0500 Received: by horse.redhat.com (Postfix, from userid 10451) id 253FA204440; Thu, 2 Mar 2017 12:06:57 -0500 (EST) Date: Thu, 2 Mar 2017 12:06:57 -0500 From: Vivek Goyal To: James Bottomley Cc: Djalal Harouni , Chris Mason , Theodore Tso , Josh Triplett , "Eric W. Biederman" , Andy Lutomirski , Seth Forshee , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, Dongsu Park , David Herrmann , Miklos Szeredi , Alban Crequy , Al Viro , "Serge E. Hallyn" , Phil Estes , Amir Goldstein Subject: Re: [RFC v2 1/1] shiftfs: uid/gid shifting bind mount Message-ID: <20170302170657.GI17411@redhat.com> References: <1487637902.2337.47.camel@HansenPartnership.com> <1487638025.2337.49.camel@HansenPartnership.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1487638025.2337.49.camel@HansenPartnership.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 02 Mar 2017 17:06:59 +0000 (UTC) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Feb 20, 2017 at 04:47:05PM -0800, James Bottomley wrote: [..] > +static int shiftfs_readlink(struct dentry *dentry, char __user *data, > + int flags) > +{ > + struct dentry *real = dentry->d_fsdata; > + const struct inode_operations *iop = real->d_inode->i_op; > + > + if (iop->readlink) > + return iop->readlink(real, data, flags); > + > + return -EINVAL; > +} > + Hi James, I was testing shiftfs on top of xfs and noticed readlink() is failing as xfs does not define readlink. Following patch fixes it for me. Vivek --- fs/shiftfs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: rhvgoyal-linux/fs/shiftfs.c =================================================================== --- rhvgoyal-linux.orig/fs/shiftfs.c 2017-02-28 11:07:04.360579594 -0500 +++ rhvgoyal-linux/fs/shiftfs.c 2017-03-02 11:59:17.484345405 -0500 @@ -179,12 +179,8 @@ static int shiftfs_readlink(struct dentr int flags) { struct dentry *real = dentry->d_fsdata; - const struct inode_operations *iop = real->d_inode->i_op; - if (iop->readlink) - return iop->readlink(real, data, flags); - - return -EINVAL; + return vfs_readlink(real, data, flags); } static const char *shiftfs_get_link(struct dentry *dentry, struct inode *inode,