Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbbKKQdt (ORCPT ); Wed, 11 Nov 2015 11:33:49 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:51485 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbbKKQdr (ORCPT ); Wed, 11 Nov 2015 11:33:47 -0500 Date: Wed, 11 Nov 2015 16:33:39 +0000 From: Al Viro To: Stephen Rothwell Cc: Linus Torvalds , Sasha Levin , Andrey Ryabinin , Matthew Wilcox , Chuck Ebbert , linux-fsdevel , LKML , Jens Axboe , Dan Williams Subject: Re: fs: out of bounds on stack in iov_iter_advance Message-ID: <20151111163339.GM22011@ZenIV.linux.org.uk> References: <20151106013402.GT22011@ZenIV.linux.org.uk> <20151106021858.GU22011@ZenIV.linux.org.uk> <20151111025647.GG22011@ZenIV.linux.org.uk> <20151111033007.GI22011@ZenIV.linux.org.uk> <20151111074330.GK22011@ZenIV.linux.org.uk> <20151111191636.17e4ac62@canb.auug.org.au> <20151111101948.GL22011@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151111101948.GL22011@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4884 Lines: 152 On Wed, Nov 11, 2015 at 10:19:48AM +0000, Al Viro wrote: > I'll cook the minimal fixup for API change after I get some sleep and > send it your way, unless somebody gets there first... This should do it - switches ->ioctl() to pvfs2_inode_[gs]etxattr() and converts xattr_handler ->[gs]et() to new API. Signed-off-by: Al Viro --- diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index feb1764..3d6ffe0 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -793,11 +793,10 @@ static long pvfs2_ioctl(struct file *file, unsigned int cmd, unsigned long arg) */ if (cmd == FS_IOC_GETFLAGS) { val = 0; - ret = pvfs2_xattr_get_default(file->f_path.dentry, - "user.pvfs2.meta_hint", - &val, - sizeof(val), - 0); + ret = pvfs2_inode_getxattr(file_inode(file), + PVFS2_XATTR_NAME_DEFAULT_PREFIX, + "user.pvfs2.meta_hint", + &val, sizeof(val)); if (ret < 0 && ret != -ENODATA) return ret; else if (ret == -ENODATA) @@ -827,12 +826,10 @@ static long pvfs2_ioctl(struct file *file, unsigned int cmd, unsigned long arg) gossip_debug(GOSSIP_FILE_DEBUG, "pvfs2_ioctl: FS_IOC_SETFLAGS: %llu\n", (unsigned long long)val); - ret = pvfs2_xattr_set_default(file->f_path.dentry, - "user.pvfs2.meta_hint", - &val, - sizeof(val), - 0, - 0); + ret = pvfs2_inode_setxattr(file_inode(file), + PVFS2_XATTR_NAME_DEFAULT_PREFIX, + "user.pvfs2.meta_hint", + &val, sizeof(val), 0); } return ret; diff --git a/fs/orangefs/pvfs2-kernel.h b/fs/orangefs/pvfs2-kernel.h index 29b4a48..43339c6 100644 --- a/fs/orangefs/pvfs2-kernel.h +++ b/fs/orangefs/pvfs2-kernel.h @@ -237,19 +237,6 @@ extern const struct xattr_handler *pvfs2_xattr_handlers[]; extern struct posix_acl *pvfs2_get_acl(struct inode *inode, int type); extern int pvfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type); -int pvfs2_xattr_set_default(struct dentry *dentry, - const char *name, - const void *buffer, - size_t size, - int flags, - int handler_flags); - -int pvfs2_xattr_get_default(struct dentry *dentry, - const char *name, - void *buffer, - size_t size, - int handler_flags); - /* * Redefine xtvec structure so that we could move helper functions out of * the define diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 227eaa4..b683daa 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -447,12 +447,12 @@ out_unlock: return ret; } -int pvfs2_xattr_set_default(struct dentry *dentry, - const char *name, - const void *buffer, - size_t size, - int flags, - int handler_flags) +static int pvfs2_xattr_set_default(const struct xattr_handler *handler, + struct dentry *dentry, + const char *name, + const void *buffer, + size_t size, + int flags) { return pvfs2_inode_setxattr(dentry->d_inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, @@ -462,11 +462,11 @@ int pvfs2_xattr_set_default(struct dentry *dentry, flags); } -int pvfs2_xattr_get_default(struct dentry *dentry, - const char *name, - void *buffer, - size_t size, - int handler_flags) +static int pvfs2_xattr_get_default(const struct xattr_handler *handler, + struct dentry *dentry, + const char *name, + void *buffer, + size_t size) { return pvfs2_inode_getxattr(dentry->d_inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, @@ -476,12 +476,12 @@ int pvfs2_xattr_get_default(struct dentry *dentry, } -static int pvfs2_xattr_set_trusted(struct dentry *dentry, - const char *name, - const void *buffer, - size_t size, - int flags, - int handler_flags) +static int pvfs2_xattr_set_trusted(const struct xattr_handler *handler, + struct dentry *dentry, + const char *name, + const void *buffer, + size_t size, + int flags) { return pvfs2_inode_setxattr(dentry->d_inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, @@ -491,11 +491,11 @@ static int pvfs2_xattr_set_trusted(struct dentry *dentry, flags); } -static int pvfs2_xattr_get_trusted(struct dentry *dentry, - const char *name, - void *buffer, - size_t size, - int handler_flags) +static int pvfs2_xattr_get_trusted(const struct xattr_handler *handler, + struct dentry *dentry, + const char *name, + void *buffer, + size_t size) { return pvfs2_inode_getxattr(dentry->d_inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/