[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <386ef374-25f2-4a10-bd15-0913137f1c9f@oracle.com>
Date: Fri, 23 Aug 2024 13:30:19 -0500
From: Dave Kleikamp <dave.kleikamp@...cle.com>
To: Edward Adam Davis <eadavis@...com>
Cc: jfs-discussion@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
syzbot+dca05492eff41f604890@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH V2] jfs: check if leafidx greater than num leaves per dmap
tree
On 7/26/24 8:42PM, Edward Adam Davis wrote:
> syzbot report a out of bounds in dbSplit, it because dmt_leafidx greater
> than num leaves per dmap tree, add a checking for dmt_leafidx in dbFindLeaf.
>
> Reported-and-tested-by: syzbot+dca05492eff41f604890@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=dca05492eff41f604890
> Signed-off-by: Edward Adam Davis <eadavis@...com>
> ---
> fs/jfs/jfs_dmap.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
> index cb3cda1390ad..516bac758053 100644
> --- a/fs/jfs/jfs_dmap.c
> +++ b/fs/jfs/jfs_dmap.c
> @@ -2976,6 +2976,8 @@ static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
> */
> assert(n < 4);
> }
> + if (le32_to_cpu(tp->dmt_leafidx) >= LPERDMAP)
> + return -ENOSPC;
NACK. It needs to be smarter than this.
dbFindLeaf() can be called with a control page in which dmt_leafidx is
bound by LPERCTL, which is larger than LPERDMAP.
>
> /* set the return to the leftmost leaf describing sufficient
> * free space.
Powered by blists - more mailing lists