[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e8a54739-340f-45dd-9018-c32154d23ef5@oracle.com>
Date: Thu, 20 Feb 2025 10:21:18 -0600
From: Dave Kleikamp <dave.kleikamp@...cle.com>
To: Edward Adam Davis <eadavis@...com>
Cc: axboe@...nel.dk, jfs-discussion@...ts.sourceforge.net, kristian@...usen.dk,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH V2] jfs: add sanity check for agwidth in dbMount
On 2/20/25 5:24AM, Edward Adam Davis wrote:
> The width in dmapctl of the AG is zero, it trigger a divide error when
> calculating the control page level in dbAllocAG.
>
> To avoid this issue, add a check for agwidth in dbAllocAG.
Looks good. Will add this to jfs-next.
Thanks,
Shaggy
>
> Reported-and-tested-by: syzbot+7c808908291a569281a9@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=7c808908291a569281a9
> Signed-off-by: Edward Adam Davis <eadavis@...com>
> ---
> V1 -> V2: move the check to dbMount
>
> fs/jfs/jfs_dmap.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
> index f9009e4f9ffd..62f55e7ed840 100644
> --- a/fs/jfs/jfs_dmap.c
> +++ b/fs/jfs/jfs_dmap.c
> @@ -204,6 +204,10 @@ int dbMount(struct inode *ipbmap)
> bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel);
> bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight);
> bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
> + if (!bmp->db_agwidth) {
> + err = -EINVAL;
> + goto err_release_metapage;
> + }
> bmp->db_agstart = le32_to_cpu(dbmp_le->dn_agstart);
> bmp->db_agl2size = le32_to_cpu(dbmp_le->dn_agl2size);
> if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG ||
Powered by blists - more mailing lists