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:	Fri, 4 Apr 2008 13:56:13 -0400
From:	Erez Zadok <ezk@...sunysb.edu>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
	dave@...ux.vnet.ibm.com, ezk@...sunysb.edu,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 07/10] vfs: add path_rename() 

In message <20080402201330.689695350@...redi.hu>, Miklos Szeredi writes:
> From: Miklos Szeredi <mszeredi@...e.cz>
> 
> Introduce path_rename().  Make vfs_rename() static.
[...]
> +int path_rename(struct path *old_dir_path, struct dentry *old_dentry,
> +		struct inode *new_dir, struct dentry *new_dentry)
> +{
> +	int error = mnt_want_write(old_dir_path->mnt);
> +
> +	if (!error) {
> +		struct inode *old_dir = old_dir_path->dentry->d_inode;
> +
> +		error = vfs_rename(old_dir, old_dentry, new_dir, new_dentry);
> +		mnt_drop_write(old_dir_path->mnt);
> +	}
> +
> +	return error;
> +}
> +EXPORT_SYMBOL(path_rename);

You're grabbing a want_write ref on the source vfsmount only.  Shouldn't
path_rename() call mnt_want_write on *both* the source and destination
vfsmounts?  If so, do we need to order the locks ala lock_rename()?

Erez.
--
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