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] [thread-next>] [day] [month] [year] [list]
Message-ID: <aMrkjSRJ0yyEfvfl@google.com>
Date: Wed, 17 Sep 2025 16:40:45 +0000
From: Jaegeuk Kim <jaegeuk@...nel.org>
To: Chao Yu <chao@...nel.org>
Cc: linux-f2fs-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	wangzijie <wangzijie1@...or.com>
Subject: Re: [PATCH] f2fs: add sanity check on ei.len in
 __update_extent_tree_range()

Do we need this?

On 09/16, Chao Yu wrote:
> Add a sanity check in __update_extent_tree_range() to detect any
> zero-sized extent update.
> 
> Signed-off-by: wangzijie <wangzijie1@...or.com>
> Signed-off-by: Chao Yu <chao@...nel.org>
> ---
>  fs/f2fs/extent_cache.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
> index 199c1e7a83ef..3070d1cb0676 100644
> --- a/fs/f2fs/extent_cache.c
> +++ b/fs/f2fs/extent_cache.c
> @@ -664,6 +664,15 @@ static void __update_extent_tree_range(struct inode *inode,
>  	if (!et)
>  		return;
>  
> +	if (unlikely(len == 0)) {
> +		f2fs_err_ratelimited(sbi, "%s: extent len is zero, type: %d, "
> +			"extent [%u, %u, %u], age [%llu, %llu]",
> +			__func__, type, tei->fofs, tei->blk, tei->len,
> +			tei->age, tei->last_blocks);
> +		f2fs_bug_on(sbi, 1);
> +		return;
> +	}
> +
>  	if (type == EX_READ)
>  		trace_f2fs_update_read_extent_tree_range(inode, fofs, len,
>  						tei->blk, 0);
> -- 
> 2.49.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ