From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: paeyz <iwasbaeyz@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@kernel.org, Kees Cook <kees@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH v2] adfs: validate nzones in adfs_validate_bblk()
Date: Fri, 20 Mar 2026 16:08:26 +0000 [thread overview]
Message-ID: <ab1w-qScoY8mnAT4@shell.armlinux.org.uk> (raw)
In-Reply-To: <2026032011-encrypt-embattled-1a25@gregkh>
On Fri, Mar 20, 2026 at 05:04:07PM +0100, Greg KH wrote:
> On Sat, Mar 21, 2026 at 12:52:13AM +0900, paeyz wrote:
> > From: Bae Yeonju <iwasbaeyz@gmail.com>
> >
> > Reject ADFS disc records with a zero zone count during boot block
> > validation, before the disc record is used.
> >
> > When nzones is 0, adfs_read_map() passes it to kmalloc_array(0, ...)
> > which returns ZERO_SIZE_PTR, and adfs_map_layout() then writes to
> > dm[-1], causing an out-of-bounds write before the allocated buffer.
> >
> > adfs_validate_dr0() already rejects nzones != 1 for old-format
> > images. Add the equivalent check to adfs_validate_bblk() for
> > new-format images so that a crafted image with nzones == 0 is
> > rejected at probe time.
> >
> > Found by syzkaller.
> >
> > Fixes: f6f14a0d71b0 ("fs/adfs: map: move map-specific sb initialisation to map.c")
> > Tested-by: Bae Yeonju <iwasbaeyz@gmail.com>
> > Signed-off-by: Bae Yeonju <iwasbaeyz@gmail.com>
>
> Nit, no need for Tested-by if you sign off on the change :)
>
> > ---
> > fs/adfs/super.c | 3 +++
> > 1 file changed, 3 insertions(+)
>
> The version info from what changed goes below the --- line.
>
> Anyway, who takes adfs changes these days? Russell do you? There's no
> MAINTAINERS entry that I can find. If no one else, I can take it
> through one of my trees.
I have done, as I'm the author of this fs driver.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2026-03-20 16:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 14:23 [PATCH] adfs: validate nzones in adfs_read_map() Greg Kroah-Hartman
2026-03-20 14:37 ` Russell King (Oracle)
2026-03-20 15:05 ` Greg Kroah-Hartman
2026-03-20 15:21 ` paeyz
2026-03-20 15:40 ` Greg KH
2026-03-20 15:52 ` [PATCH v2] adfs: validate nzones in adfs_validate_bblk() paeyz
2026-03-20 16:04 ` Greg KH
2026-03-20 16:08 ` Russell King (Oracle) [this message]
2026-03-20 16:11 ` Greg KH
2026-03-21 4:45 ` [PATCH v3] " paeyz
2026-03-20 16:05 ` [PATCH] adfs: validate nzones in adfs_read_map() Russell King (Oracle)
2026-03-20 16:02 ` Russell King (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab1w-qScoY8mnAT4@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=iwasbaeyz@gmail.com \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox