[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <zawjh5ifsd73ogmypgqagbbmzpy4qijtcxq6wrykiowehoc23r@fk24ul4tt6v7>
Date: Mon, 24 Nov 2025 18:31:33 +0100
From: Jan Kara <jack@...e.cz>
To: Jori Koolstra <jkoolstra@...all.nl>
Cc: Christian Brauner <brauner@...nel.org>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>, Jan Kara <jack@...e.cz>, Taotao Chen <chentaotao@...iglobal.com>,
Shuah Khan <skhan@...uxfoundation.org>, linux-kernel@...r.kernel.org,
syzbot+5ad0824204c7bf9b67f2@...kaller.appspotmail.com
Subject: Re: [PATCH 2/3] Add required sanity checking to
minix_check_superblock()
On Mon 17-11-25 23:05:21, Jori Koolstra wrote:
> The fs/minix implementation of the minix filesystem does not currently
> support any other value for s_log_zone_size than 0. This is also the
> only value supported in util-linux; see mkfs.minix.c line 511. In
> addition, this patch adds some sanity checking for the other minix
> superblock fields.
>
> This also closes a related syzbot bug report.
>
> Signed-off-by: Jori Koolstra <jkoolstra@...all.nl>
> Reported-by: syzbot+5ad0824204c7bf9b67f2@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=5ad0824204c7bf9b67f2
> ---
> fs/minix/inode.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/fs/minix/inode.c b/fs/minix/inode.c
> index 7897f5123b3d..8eb26ff91adf 100644
> --- a/fs/minix/inode.c
> +++ b/fs/minix/inode.c
> @@ -171,7 +171,14 @@ static bool minix_check_superblock(struct super_block *sb)
> {
> struct minix_sb_info *sbi = minix_sb(sb);
>
> - if (sbi->s_imap_blocks == 0 || sbi->s_zmap_blocks == 0)
> + if (sbi->s_log_zone_size != 0) {
> + printk("minix-fs error: zone size must equal block size. "
> + "s_log_zone_size > 0 is not supported.\n");
> + return false;
> + }
> +
> + if (sbi->s_ninodes < 1 || sbi->s_firstdatazone <= 4 ||
> + sbi->s_firstdatazone >= sbi->s_nzones)
> return false;
OK, but why did you remove the s_imap_blocks and s_zmap_blocks checks?
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists