grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kiper <dkiper@net-space.pl>
To: Jon DeVree <nuxi@vault24.org>
Cc: grub-devel@gnu.org, Lidong Chen <lidong.chen@oracle.com>,
	Marta Lewandowska <mlewando@redhat.com>
Subject: Re: [PATCH v3] Fix XFS directory extent parsing
Date: Mon, 16 Oct 2023 19:49:30 +0200	[thread overview]
Message-ID: <20231016174930.7ogcxi5y4pf7dzgo@tomti.i.net-space.pl> (raw)
In-Reply-To: <ZSCC_cQqQkqKWhya@feynman.vault24.org>

On Fri, Oct 06, 2023 at 05:58:21PM -0400, Jon DeVree wrote:
> On Wed, Oct 04, 2023 at 00:43:18 +0000, Lidong Chen wrote:
> > - if (filename + direntry->len - 1 > (char *) tail)
> > + if (filename + direntry->len + 1 > (char *) end)
> >  return grub_error (GRUB_ERR_BAD_FS, "invalid XFS directory entry");
> >
> > There were these lines in the source after the diff:
> >
> >    /* The byte after the filename is for the filetype, padding, or
> >       tag, which is not used by GRUB.  So it can be overwritten. */
> >       filename[direntry->len] = '\0’;
> >
> > I wonder if  “filename + direntry->len + 1 > (char *) end”  could
> > result in a failure on the valid filesystem.
> >
>
> According to my reading of the XFS specifications, all valid filesystems
> will have either 2 or 3 bytes in the structure after the filename. Older
> filesystems (ftypoe=0) will have 2 bytes and newer filesystems (ftype=1)
> will have 3 bytes.

OK but then this change requires description in the commit message or
separate patch.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

      reply	other threads:[~2023-10-16 17:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  0:43 [PATCH v3] Fix XFS directory extent parsing Jon DeVree
2023-10-04  0:43 ` Lidong Chen
2023-10-06 21:58   ` Jon DeVree
2023-10-16 17:49     ` Daniel Kiper [this message]

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=20231016174930.7ogcxi5y4pf7dzgo@tomti.i.net-space.pl \
    --to=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=lidong.chen@oracle.com \
    --cc=mlewando@redhat.com \
    --cc=nuxi@vault24.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).