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: <5a7ba595350d1aabf7e5ba4deeac4d2707a101ff.camel@ibm.com>
Date: Fri, 27 Jun 2025 19:52:19 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: Xiubo Li <xiubli@...hat.com>,
        "dan.carpenter@...aro.org"
	<dan.carpenter@...aro.org>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
        "idryomov@...il.com" <idryomov@...il.com>,
        "willy@...radead.org"
	<willy@...radead.org>,
        "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>,
        "ceph-devel@...r.kernel.org"
	<ceph-devel@...r.kernel.org>,
        "akpm@...ux-foundation.org"
	<akpm@...ux-foundation.org>
Subject: Re:  [PATCH] ceph: fix NULL vs IS_ERR() bug in ceph_zero_partial_page()

On Wed, 2025-06-25 at 10:22 -0500, Dan Carpenter wrote:
> The filemap_lock_folio() never returns NULL.  It returns error pointers.
> Update the checking to match.
> 
> Fixes: 483239f03149 ("ceph: convert ceph_zero_partial_page() to use a folio")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  fs/ceph/file.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/ceph/file.c b/fs/ceph/file.c
> index d5c674d2ba8a..f6e63265c516 100644
> --- a/fs/ceph/file.c
> +++ b/fs/ceph/file.c
> @@ -2536,12 +2536,13 @@ static inline void ceph_zero_partial_page(struct inode *inode,
>  	struct folio *folio;
>  
>  	folio = filemap_lock_folio(inode->i_mapping, offset >> PAGE_SHIFT);
> -	if (folio) {
> -		folio_wait_writeback(folio);
> -		folio_zero_range(folio, offset_in_folio(folio, offset), size);
> -		folio_unlock(folio);
> -		folio_put(folio);
> -	}
> +	if (IS_ERR(folio))
> +		return;
> +
> +	folio_wait_writeback(folio);
> +	folio_zero_range(folio, offset_in_folio(folio, offset), size);
> +	folio_unlock(folio);
> +	folio_put(folio);
>  }
>  
>  static void ceph_zero_pagecache_range(struct inode *inode, loff_t offset,

Looks good!

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@....com>

Thanks,
Slava.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ