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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20091021202504.0daf2be7.krzysztof.h1@wp.pl>
Date:	Wed, 21 Oct 2009 20:25:04 +0200
From:	Krzysztof Helt <krzysztof.h1@...pl>
To:	Dave Kleikamp <shaggy@...ux.vnet.ibm.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	jfs-discussion@...ts.sourceforge.net
Subject: Re: [Jfs-discussion] [PATCH] jfs: lockdep fix

On Tue, 20 Oct 2009 15:00:23 -0500
Dave Kleikamp <shaggy@...ux.vnet.ibm.com> wrote:
> I proposed another fix here:
> http://bugzilla.kernel.org/show_bug.cgi?id=13613
> 
> It seems I haven't followed up and submitted it to the vfs maintainer.
> Could you please give that patch a try and see if it fixes the problem
> for you?
> 

Your patch fixes the previously reported (old) lockdep problem.  I am not able to trigger 
the lockdep report while it takes a few minutes without the patch. 

Tested-by: Krzysztof Helt <krzysztof.h1@...pl>

Your fix I have tested is below:

VFS: Fix potential deadlock in __read_cache_page()

lockdep reports a potential deadlock when using jfs because
add_to_page_cache_lru() is called from __read_cache_page() with GFP_KERNEL.

Detailed lockdep output can be found at
http://bugzilla.kernel.org/show_bug.cgi?id=13613

Passing mapping_gfp_mask(mapping) instead of GFP_KERNEL fixes the problem.

Signed-off-by: Dave Kleikamp <shaggy@...ux.vnet.ibm.com>

diff --git a/mm/filemap.c b/mm/filemap.c
index ccea3b6..59f5406 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1702,7 +1702,8 @@ repeat:
 		page = page_cache_alloc_cold(mapping);
 		if (!page)
 			return ERR_PTR(-ENOMEM);
-		err = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
+		err = add_to_page_cache_lru(page, mapping, index,
+					    mapping_gfp_mask(mapping));
 		if (unlikely(err)) {
 			page_cache_release(page);
 			if (err == -EEXIST)

--
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