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>] [day] [month] [year] [list]
Message-Id: <20260105-ntfs3-restore-null-folio-init-v1-1-432093703dfd@kernel.org>
Date: Mon, 05 Jan 2026 12:17:10 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
Cc: ntfs3@...ts.linux.dev, linux-kernel@...r.kernel.org, 
 llvm@...ts.linux.dev, kernel test robot <lkp@...el.com>, 
 Nathan Chancellor <nathan@...nel.org>
Subject: [PATCH] ntfs3: Restore NULL folio initialization in
 ntfs_writepages()

Clang warns (or errors with CONFIG_WERROR=y):

  fs/ntfs3/inode.c:1021:6: error: variable 'folio' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
   1021 |         if (is_resident(ni)) {
        |             ^~~~~~~~~~~~~~~
  fs/ntfs3/inode.c:1024:48: note: uninitialized use occurs here
   1024 |                 while ((folio = writeback_iter(mapping, wbc, folio, &err)))
        |                                                              ^~~~~

folio should be initialized to NULL for the first iteration of
writeback_iter() to start the loop properly. Restore the NULL
initialization of folio that was lost in the recent iomap conversion to
clear up the warning.

Fixes: 099ef9ab9203 ("fs/ntfs3: implement iomap-based file operations")
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601010644.FIhOXy6Y-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@...nel.org>
---
 fs/ntfs3/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index b969ad7c3258..438d468f28ba 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -1019,7 +1019,7 @@ static int ntfs_writepages(struct address_space *mapping,
 		return -EIO;
 
 	if (is_resident(ni)) {
-		struct folio *folio;
+		struct folio *folio = NULL;
 
 		while ((folio = writeback_iter(mapping, wbc, folio, &err)))
 			err = ntfs_resident_writepage(folio, wbc);

---
base-commit: 099ef9ab9203dff327f2d61e44773f9acbc01f13
change-id: 20260105-ntfs3-restore-null-folio-init-e3d7a7d6dd01

Best regards,
--  
Nathan Chancellor <nathan@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ