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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 15 Jan 2014 18:32:43 -0500
From:	Tejun Heo <tj@...nel.org>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	Veaceslav Falico <vfalico@...hat.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [RFC] sysfs_rename_link() and its usage

Hey, Eric.

On Wed, Jan 15, 2014 at 03:25:16PM -0800, Eric W. Biederman wrote:
> diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
> index 3ae3f1bf1a09..651444a9d1c5 100644
> --- a/fs/sysfs/symlink.c
> +++ b/fs/sysfs/symlink.c
> @@ -194,12 +194,10 @@ EXPORT_SYMBOL_GPL(sysfs_remove_link);
>   *	@targ:	object we're pointing to.
>   *	@old:	previous name of the symlink.
>   *	@new:	new name of the symlink.
> - *	@new_ns: new namespace of the symlink.
> - *
>   *	A helper function for the common rename symlink idiom.
>   */
> -int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
> -			 const char *old, const char *new, const void *new_ns)
> +int sysfs_rename_link(struct kobject *kobj, struct kobject *targ,
> +		      const char *old, const char *new)
>  {
>  	struct sysfs_dirent *parent_sd, *sd = NULL;
>  	const void *old_ns = NULL;
> @@ -224,13 +222,13 @@ int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
>  	if (sd->s_symlink.target_sd->s_dir.kobj != targ)
>  		goto out;
>  
> -	result = sysfs_rename(sd, parent_sd, new, new_ns);
> +	result = sysfs_rename(sd, parent_sd, new, kobject_namespace(targ));

Oh yeah, this is a lot better.  It's kinda weird that it requires
sysfs user to invoke sysfs_rename_link() without actually specifying
anything which has changed after namespace update tho.  The best thing
would be just tying the namespace of symlink to its target so that it
gets updated automatically along with the target without requiring
this separate step.  Ah well, we don't maintain backlinks (yet), so
this should do for now, I suppose.

Thanks.

-- 
tejun
--
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