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]
Message-ID: <20120109171652.GA3904@suse.de>
Date:	Mon, 9 Jan 2012 09:16:52 -0800
From:	Greg KH <gregkh@...e.de>
To:	Miklos Szeredi <miklos@...redi.hu>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, mgorman@...e.de, hch@...radead.org,
	akpm@...ux-foundation.org
Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock

On Mon, Jan 09, 2012 at 06:05:32PM +0100, Miklos Szeredi wrote:
> Linus Torvalds <torvalds@...ux-foundation.org> writes:
> 
> > On Mon, Jan 9, 2012 at 2:58 AM, Miklos Szeredi <miklos@...redi.hu> wrote:
> >>
> >> This patch adds a new dentry flag that is set when the dentry is removed
> >> from the lru and put on the list being processed by
> >> shrink_dentry_list().  The flag is cleared in dentry_lru_del() which is
> >> called if the dentry gets a new reference just before it's pruned.
> >>
> >> Thoughts?
> >
> > Looks reasonable. Were you actually able to reproduce the hang, or how
> > did you notice?
> 
> We got a bug report from a partner about hang during reboot.  It's
> actually quite easily reproducible with:
> 
> while true; do
>         echo -bond0 > /sys/class/net/bonding_masters
>         echo +bond0 > /sys/class/net/bonding_masters
>         echo -bond1 > /sys/class/net/bonding_masters
>         echo +bond1 > /sys/class/net/bonding_masters
> done
> 
> That reliably triggers the soft lookup detector for several machines
> that we tested.  It's rather timing sensitive though, because turning on
> DEBUG_SPINLOCK makes it go away.
> 
> I had to add printks to see what's going on, because it wasn't obvious
> from the stack traces and crash dumps.

You also usually need to add a udev rule that looks at the pci id of the
device as well, without checking for what type it is (which is what a
"correct" udev rule should be doing, which is why we only started seeing
this on some systems, with "incorrect" rules.)

Having a file in /lib/udev/rules.d/ with only this one rule:
ATTR{vendor}=="0x8086", ATTR{device}=="0x10ca", ENV{PCI_SLOT_NAME}="%k", ENV{MATCHADDR}="$attr{address}", RUN+="/bin/true"

Seems to do the trick.  udev calls stat() on the vendor sysfs file,
while it is going away, and then this dentry race shows up.

thanks,

greg k-h
--
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