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  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:	Sun, 17 Jan 2010 19:03:51 +0100
From:	Dominik Brodowski <>
To:	"Eric W. Biederman" <>
Cc:	Ming Lei <>, Greg KH <>,
	Linus Torvalds <>,
	KOSAKI Motohiro <>,
	Borislav Petkov <>,
	David Airlie <>,
	Linux Kernel Mailing List <>,
	Al Viro <>, Tejun Heo <>,
	Peter Zijlstra <>,
	Ingo Molnar <>,
Subject: Re: [PATCH] sysfs: Add lockdep annotations for the sysfs active reference


On Sun, Jan 17, 2010 at 09:18:34AM -0800, Eric W. Biederman wrote:
> Ming Lei <> writes:
> > On Sat, 02 Jan 2010 13:37:12 -0800
> > (Eric W. Biederman) wrote:
> >
> >> 
> >> Holding locks over device_del -> kobject_del -> sysfs_deactivate can
> >> cause deadlocks if those same locks are grabbed in sysfs show or store
> >> methods.
> >> 
> >> The I model s_active count + completion as a sleeping read/write lock.
> >> I describe to lockdep sysfs_get_active as a read_trylock,
> >> sysfs_put_active as a read_unlock, and sysfs_deactivate as a
> >> write_lock and write_unlock pair.  This seems to capture the essence
> >> for purposes of finding deadlocks, and in my testing gives finds real
> >> issues and ignores non-issues.
> >> 
> >> This brings us back to holding locks over kobject_del is a problem
> >> that ideally we should find a way of addressing, but at least lockdep
> >> can tell us about the problems instead of requiring developers to
> >> debug rare strange system deadlocks, that happen when sysfs files are
> >> removed while being written to.
> >
> > The model has hit a possible deadlock in pcmcia, and the lockdep warning
> > comes when I unplug my wlan card from pcmcia slot.
> >
> > Looks like socket->skt_mutex is held in remove path, and it is also
> > grabbed in .stor method.
> Looking a little closer this is simultaneously a legitimate problem
> and also a false positive.
> This is only legitimate if you add/remove a cardbus bridge, plugged into
> another cardbus bridge, which I think is unlikely but physically possible.

Unfortunately, it is not a false positive, as removing a PCMCIA device
racing with "pccardctl eject" seems to trigger this path as well. Patch is
being prepared...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists