Re: [PATCH] adfs: validate nzones in adfs_read_map()

From: Greg KH

Date: Fri Mar 20 2026 - 11:41:58 EST


On Sat, Mar 21, 2026 at 12:21:31AM +0900, paeyz wrote:
> From: Bae Yeonju <iwasbaeyz@xxxxxxxxx>
>
> Hi,
>
> I tested moving the nzones validation to adfs_validate_bblk() on
> 6.12.36 with KASAN enabled.
>
> With this change, a crafted image with nzones=0 is rejected during
> validation:
>
> ADFS-fs (loop0): error: can't find an ADFS filesystem on dev loop0.
>
> mount() returns -EINVAL, and no crash or KASAN report is observed.
>
> So the issue can be prevented by validating nzones earlier in the
> validation path.
>
> Tested-by: Bae Yeonju <iwasbaeyz@xxxxxxxxx>

Great, can you rework your patch to move the check to that location and
send it?

thanks,

greg k-h