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  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:	Fri, 1 Jun 2007 21:15:11 +0400
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Eric Sandeen <sandeen@...deen.net>, Jan Kara <jack@...e.cz>
Subject: Re: [PATCH 2/2] Fix possible leakage of blocks in UDF

[Andrew Morton - Fri, Jun 01, 2007 at 10:04:25AM -0700]
| On Fri, 1 Jun 2007 20:49:26 +0400 Cyrill Gorcunov <gorcunov@...il.com> wrote:
| 
| > [Eric Sandeen - Thu, May 31, 2007 at 12:46:15PM -0500]
| > | Cyrill Gorcunov wrote:
| > | 
| > | >Eric, could you please try the following:
| > | >
| > | >1) declare the spinlock in the top of inode.c as
| > | >
| > | >	DEFINE_SPINLOCK(udf_drop_lock);
| > | >
| > | >2) replace in udf_drop_inode()
| > | >
| > | >	kernel_lock -> spin_lock(&udf_drop_lock);
| > | >	kernel_unlock -> spin_unlock(&udf_drop_lock);
| > | >
| > | >I'm not sure if it help but you may try ;)
| > | >
| > | >		Cyrill
| > | >
| > | 
| > | I'm sure it'll avoid the deadlock but....
| > | 
| > | Any sense of what the BKL is actually trying to protect in this case?
| > | 
| > | Is it really only trying to prevent concurrent prealloc-discarders, or 
| > | is there more?
| > | 
| > | -Eric
| > | 
| > 
| > Hi Eric,
| > it seems BKL only trying to protect from concurrent discard_prealloc.
| > Moreover, a lot of UDF code does call iput with BKL held, so the only
| > solution I see is to add spinlocks to udf_drop_inode... I'm making patch
| > soon. Any comments?
| > 
| 
| Recursive lock_kernel() is OK.
| 
| spin_lock() insode lock_kernel() is OK.
| 
| lock_kernel() inside spin_lock() is not OK, but if this was happening you'd
| only rarely hit a deadlock and I think this locks up every time.
| 
| We don't know what's causing this hang, do we?
| 

Actually I've read in Robert Love book that recursive kernel_lock is
supposed but as Eric wrote "he's sure spin_lock will avoid deadlock"...
So I'm investigating this (unfortunelly can't test it myself - have
UDF compiled into kernel :(.

		Cyrill

-
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