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-prev] [day] [month] [year] [list]
Message-ID: <104e68d7-9b50-4318-ae64-8a22093c6e92@paragon-software.com>
Date: Fri, 16 Jan 2026 14:46:06 +0100
From: Konstantin Komarov <almaz.alexandrovich@...agon-software.com>
To: Nathan Chancellor <nathan@...nel.org>
CC: <ntfs3@...ts.linux.dev>, <linux-kernel@...r.kernel.org>,
	<llvm@...ts.linux.dev>, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] ntfs3: Restore NULL folio initialization in
 ntfs_writepages()

On 1/5/26 20:17, Nathan Chancellor wrote:

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

Queued for the next merge window, thanks.

Regards,
Konstantin


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ