lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Sep 2010 10:57:13 +0530
From:	"Aneesh Kumar K. V" <aneesh.kumar@...ux.vnet.ibm.com>
To:	hch@...radead.org, viro@...iv.linux.org.uk, adilger@....com,
	corbet@....net, neilb@...e.de, npiggin@...nel.dk,
	hooanon05@...oo.co.jp, bfields@...ldses.org, miklos@...redi.hu
Cc:	linux-fsdevel@...r.kernel.org, sfrench@...ibm.com,
	philippe.deniel@....FR, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -V20 03/12] vfs: Add open by file handle support

On Wed, 29 Sep 2010 01:06:41 +0530, "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com> wrote:
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
> ---
>  fs/compat.c              |   11 +++
>  fs/exportfs/expfs.c      |    2 +
>  fs/namei.c               |  223 +++++++++++++++++++++++++++++++++++++++++++---
>  fs/open.c                |   32 ++++++-
>  include/linux/fs.h       |   10 ++-
>  include/linux/namei.h    |    1 +
>  include/linux/syscalls.h |    3 +
>  7 files changed, 263 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/compat.c b/fs/compat.c
> index 0644a15..4a423fa 100644
> --- a/fs/compat.c
> +++ b/fs/compat.c
> @@ -2334,3 +2334,14 @@ asmlinkage long compat_sys_timerfd_gettime(int ufd,
>  }
> 
>  #endif /* CONFIG_TIMERFD */
> +
> +/*
> + * Exactly like fs/open.c:sys_open_by_handle_at(), except that it
> + * doesn't set the O_LARGEFILE flag.
> + */
> +asmlinkage long
> +compat_sys_open_by_handle_at(int mountdirfd,
> +			     struct file_handle __user *handle, int flags)
> +{
> +	return do_handle_open(mountdirfd, handle, flags);
> +}
> diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
> index cfee0f0..05a1179 100644
> --- a/fs/exportfs/expfs.c
> +++ b/fs/exportfs/expfs.c
> @@ -373,6 +373,8 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
>  	/*
>  	 * Try to get any dentry for the given file handle from the filesystem.
>  	 */
> +	if (!nop || !nop->fh_to_dentry)
> +		return ERR_PTR(-ESTALE);
>  	result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type);
>  	if (!result)
>  		result = ERR_PTR(-ESTALE);
> diff --git a/fs/namei.c b/fs/namei.c
> index 24896e8..3439962 100644
> --- a/fs/namei.c
> +++ b/fs/namei.c
> @@ -32,6 +32,7 @@
>  #include <linux/fcntl.h>
>  #include <linux/device_cgroup.h>
>  #include <linux/fs_struct.h>
> +#include <linux/exportfs.h>
>  #include <asm/uaccess.h>
> 
>  #include "internal.h"
> @@ -1050,6 +1051,29 @@ out_fail:
>  	return retval;
>  }
> 
> +struct vfsmount *get_vfsmount_from_fd(int fd)
> +{
> +	int fput_needed;
> +	struct path path;
> +	struct file *filep;
> +
> +	if (fd == AT_FDCWD) {
> +		struct fs_struct *fs = current->fs;
> +		spin_lock(&fs->lock);
> +		path = fs->pwd;
> +		mntget(path.mnt);
> +		spin_lock(&fs->lock);

That should be spin_unlock.  A missing stg refresh before sending the
patch series. 

-aneesh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ