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-next>] [day] [month] [year] [list]
Message-ID: <20120731082943.GB14475@localhost>
Date:	Tue, 31 Jul 2012 16:29:43 +0800
From:	Fengguang Wu <fengguang.wu@...el.com>
To:	Jan Kara <jack@...e.cz>
Cc:	Al Viro <viro@...iv.linux.org.uk>, linux-fsdevel@...r.kernel.org,
	LKML <linux-kernel@...r.kernel.org>
Subject: [vfs:for-next] mnt_want_write: possible circular locking dependency
 detected

Hi Jan,

I caught the following warning at this commit. Note that the head
commit actually boots OK, so it may either be not 100% reproduciable,
or get fixed somewhere in your patchset.

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-next
head:   06fd516c1a504828780fcd81dfe21f94dec4c868
commit: eb04c28288bb0098d0e75d81ba2a575239de71d8 [39/52] fs: Add freezing handling to mnt_want_write() / mnt_drop_write()

[   77.094286] ======================================================
[   77.095752] [ INFO: possible circular locking dependency detected ]
[   77.096373] 3.5.0-rc6+ #137 Not tainted
[   77.096373] -------------------------------------------------------
[   77.096373] S02mountkernfs./2795 is trying to acquire lock:
[   77.096373]  (sb_writers#5){.+.+.+}, at: [<ffffffff8119760c>] mnt_want_write+0x24/0x4b
[   77.096373] 
[   77.096373] but task is already holding lock:
[   77.096373]  (&sb->s_type->i_mutex_key#9){+.+.+.}, at: [<ffffffff8118df87>] vfs_readdir+0x57/0xb5
[   77.096373] 
[   77.096373] which lock already depends on the new lock.
[   77.096373] 
[   77.096373] 
[   77.096373] the existing dependency chain (in reverse order) is:
[   77.096373] 
-> #1 (&sb->s_type->i_mutex_key#9){+.+.+.}:
[   77.096373]        [<ffffffff810ddf2f>] lock_acquire+0xd5/0x119
[   77.096373]        [<ffffffff82bed2e3>] __mutex_lock_common+0x58/0x387
[   77.096373]        [<ffffffff82bed721>] mutex_lock_nested+0x40/0x45
[   77.096373]        [<ffffffff8118ad28>] do_last+0x1dc/0xa42
[   77.096373]        [<ffffffff8118b64d>] path_openat+0xbf/0x32f
[   77.096373]        [<ffffffff8118bba9>] do_filp_open+0x38/0x86
[   77.096373]        [<ffffffff8117ddfb>] do_sys_open+0x6e/0xfb
[   77.096373]        [<ffffffff8117dea9>] sys_open+0x21/0x23
[   77.096373]        [<ffffffff82bf6aa9>] system_call_fastpath+0x16/0x1b
[   77.096373] 
-> #0 (sb_writers#5){.+.+.+}:
[   77.096373]        [<ffffffff810dd71c>] __lock_acquire+0x9b3/0xd17
[   77.096373]        [<ffffffff810ddf2f>] lock_acquire+0xd5/0x119
[   77.096373]        [<ffffffff81180701>] __sb_start_write+0x112/0x162
[   77.096373]        [<ffffffff8119760c>] mnt_want_write+0x24/0x4b
[   77.096373]        [<ffffffff811941a4>] touch_atime+0xf8/0x105
[   77.096373]        [<ffffffff8118dfbe>] vfs_readdir+0x8e/0xb5
[   77.096373]        [<ffffffff8118e0cf>] sys_getdents+0x7d/0xe4
[   77.096373]        [<ffffffff82bf6aa9>] system_call_fastpath+0x16/0x1b
[   77.096373] 
[   77.096373] other info that might help us debug this:
[   77.096373] 
[   77.096373]  Possible unsafe locking scenario:
[   77.096373] 
[   77.096373]        CPU0                    CPU1
[   77.096373]        ----                    ----
[   77.096373]   lock(&sb->s_type->i_mutex_key#9);
[   77.096373]                                lock(sb_writers#5);
[   77.096373]                                lock(&sb->s_type->i_mutex_key#9);
[   77.096373]   lock(sb_writers#5);
[   77.096373] 
[   77.096373]  *** DEADLOCK ***
[   77.096373] 
[   77.096373] 1 lock held by S02mountkernfs./2795:
[   77.096373]  #0:  (&sb->s_type->i_mutex_key#9){+.+.+.}, at: [<ffffffff8118df87>] vfs_readdir+0x57/0xb5
[   77.096373] 
[   77.096373] stack backtrace:
[   77.096373] Pid: 2795, comm: S02mountkernfs. Not tainted 3.5.0-rc6+ #137
[   77.096373] Call Trace:
[   77.096373]  [<ffffffff82baf0c1>] print_circular_bug+0x1f8/0x209
[   77.096373]  [<ffffffff810dd71c>] __lock_acquire+0x9b3/0xd17
[   77.096373]  [<ffffffff810c0f4e>] ? local_clock+0x3b/0x52
[   77.096373]  [<ffffffff810ddf2f>] lock_acquire+0xd5/0x119
[   77.096373]  [<ffffffff8119760c>] ? mnt_want_write+0x24/0x4b
[   77.096373]  [<ffffffff810da71c>] ? trace_hardirqs_off+0xd/0xf
[   77.096373]  [<ffffffff81180701>] __sb_start_write+0x112/0x162
[   77.096373]  [<ffffffff8119760c>] ? mnt_want_write+0x24/0x4b
[   77.096373]  [<ffffffff8118dce0>] ? sys_ioctl+0x7b/0x7b
[   77.096373]  [<ffffffff8119760c>] mnt_want_write+0x24/0x4b
[   77.096373]  [<ffffffff811941a4>] touch_atime+0xf8/0x105
[   77.096373]  [<ffffffff8118dfbe>] vfs_readdir+0x8e/0xb5
[   77.096373]  [<ffffffff82bf0115>] ? retint_swapgs+0x13/0x1b
[   77.096373]  [<ffffffff8118e0cf>] sys_getdents+0x7d/0xe4
[   77.096373]  [<ffffffff82bf6aa9>] system_call_fastpath+0x16/0x1b

Thanks,
Fengguang

View attachment "dmesg-kvm-waimea-3794-2012-07-31-14-33-33" of type "text/plain" (253250 bytes)

View attachment "config-3.5.0-rc6+" of type "text/plain" (123998 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ