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>] [day] [month] [year] [list]
Message-ID: <7b7f44d6-9153-4d7c-b65b-2d78febe6c7a@stanley.mountain>
Date: Wed, 8 Jan 2025 12:16:30 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: Phillip Lougher <phillip@...ashfs.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH next] squashfs: Fix a NULL vs IS_ERR() bug

The __filemap_get_folio() functoin never returns NULL, it returns
error pointers.  This incorrect check would lead to an Oops on the
following line when we pass "push_folio" to folio_test_uptodate().

Fixes: 43c73ba98b2c ("squashfs; convert squashfs_copy_cache() to take a folio")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
 fs/squashfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c
index da25d6fa45ce..eef1dd462592 100644
--- a/fs/squashfs/file.c
+++ b/fs/squashfs/file.c
@@ -409,7 +409,7 @@ void squashfs_copy_cache(struct folio *folio,
 					FGP_LOCK|FGP_CREAT|FGP_NOFS|FGP_NOWAIT,
 					mapping_gfp_mask(mapping));
 
-		if (!push_folio)
+		if (IS_ERR(push_folio))
 			continue;
 
 		if (folio_test_uptodate(push_folio))
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ