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] [thread-next>] [day] [month] [year] [list]
Message-ID: <460c4708-3ec6-4fbc-8f6c-7f8e5f901061@kernel.org>
Date: Thu, 4 Jul 2024 15:15:53 +0800
From: Chao Yu <chao@...nel.org>
To: daejun7.park@...sung.com, "jaegeuk@...nel.org" <jaegeuk@...nel.org>,
 "daehojeong@...gle.com" <daehojeong@...gle.com>,
 "linux-f2fs-devel@...ts.sourceforge.net"
 <linux-f2fs-devel@...ts.sourceforge.net>,
 "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Cc: Seokhwan Kim <sukka.kim@...sung.com>,
 Dongjin Kim <dongjin_.kim@...sung.com>,
 Yonggil Song <yonggil.song@...sung.com>,
 Jaeyoon Choi <j_yoon.choi@...sung.com>, Nayeon Kim
 <nayeoni.kim@...sung.com>, Siwoo Jung <siu.jung@...sung.com>
Subject: Re: [PATCH] f2fs: fix null reference error when checking end of zone

On 2024/7/4 9:01, Daejun Park wrote:
> This patch fixes a potentially null pointer being accessed by
> is_end_zone_blkaddr() that checks the last block of a zone
> when f2fs is mounted as a single device.

blkzoned feature depends on multiple device feature? One regular
device and one seq-zone device?

Thanks,

> 
> Fixes: e067dc3c6b9c ("f2fs: maintain six open zones for zoned devices")
> Signed-off-by: Daejun Park <daejun7.park@...sung.com>
> ---
>   fs/f2fs/data.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index b6dcb3bcaef7..1aa7eefa659c 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -925,6 +925,7 @@ int f2fs_merge_page_bio(struct f2fs_io_info *fio)
>   #ifdef CONFIG_BLK_DEV_ZONED
>   static bool is_end_zone_blkaddr(struct f2fs_sb_info *sbi, block_t blkaddr)
>   {
> +	struct block_device *bdev = sbi->sb->s_bdev;
>   	int devi = 0;
>   
>   	if (f2fs_is_multi_device(sbi)) {
> @@ -935,8 +936,9 @@ static bool is_end_zone_blkaddr(struct f2fs_sb_info *sbi, block_t blkaddr)
>   			return false;
>   		}
>   		blkaddr -= FDEV(devi).start_blk;
> +		bdev = FDEV(devi).bdev;
>   	}
> -	return bdev_is_zoned(FDEV(devi).bdev) &&
> +	return bdev_is_zoned(bdev) &&
>   		f2fs_blkz_is_seq(sbi, devi, blkaddr) &&
>   		(blkaddr % sbi->blocks_per_blkz == sbi->blocks_per_blkz - 1);
>   }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ