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] [day] [month] [year] [list]
Date:	Mon, 9 Oct 2006 09:49:15 +0200
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	Jeff Garzik <jeff@...zik.org>,
	Cornelia Huck <cornelia.huck@...ibm.com>,
	Greg KH <greg@...ah.com>, Ashok Raj <ashok.raj@...el.com>,
	Nathan Lynch <nathanl@...tin.ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 1/2] sysfs: allow removal of nonexistent sysfs groups.

On Mon, Oct 09, 2006 at 12:40:14AM -0700, Andrew Morton wrote:
> On Mon, 9 Oct 2006 09:29:20 +0200
> Heiko Carstens <heiko.carstens@...ibm.com> wrote:
> 
> > From: Heiko Carstens <heiko.carstens@...ibm.com>
> > 
> > This patch makes it safe to call sysfs_remove_group() with a name group
> > that doesn't exist. Needed to make fix cpu hotplug stuff in topology code.
> > 
> 
> Surely an attempt to remove a non-existent entry is a bug, and this
> (racy-looking) patch just covers that up?

It just tries to keep cpu hotplug code in drivers/base/topology.c simple. Since
otherwise one would have to remember if sysfs_create_group() succeeded or not.
Hmm.. thinking again, this patch looks indeed racy.

> > Index: linux-2.6/fs/sysfs/group.c
> > ===================================================================
> > --- linux-2.6.orig/fs/sysfs/group.c	2006-10-09 09:15:25.000000000 +0200
> > +++ linux-2.6/fs/sysfs/group.c	2006-10-09 09:25:23.000000000 +0200
> > @@ -68,9 +68,12 @@
> >  {
> >  	struct dentry * dir;
> >  
> > -	if (grp->name)
> > +	if (grp->name) {
> > +		if (!sysfs_dirent_exist(kobj->dentry->d_fsdata, grp->name))
> > +			return;
> >  		dir = lookup_one_len(grp->name, kobj->dentry,
> >  				strlen(grp->name));
> > +	}
> >  	else
> >  		dir = dget(kobj->dentry);
> >  
> -
> 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/
-
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