From: Ross Philipson via Grub-devel <grub-devel@gnu.org>
To: The development of GNU GRUB <grub-devel@gnu.org>,
Andrew Hamilton <adhamilt@gmail.com>
Cc: ross.philipson@oracle.com, b@horn.uk, dkiper@net-space.pl,
phcoder@gmail.com, mlewando@redhat.com,
andreas.klauer@metamorpher.de, eric.valette@gmail.com,
fzielcke@z-51.de, mate.kukri@canonical.com
Subject: Re: [PATCH v2] fs/ntfs: Check at->attr_cur after calling next_attribute()
Date: Fri, 21 Mar 2025 11:58:01 -0700 [thread overview]
Message-ID: <325b05c4-d64b-44ed-a3e9-4df8d28aa717@oracle.com> (raw)
In-Reply-To: <20250320225420.4740-1-adhamilt@gmail.com>
On 3/20/25 3:54 PM, Andrew Hamilton wrote:
> A regression was introduced recently as a part of the series of
> filesystem related patches to address some CVEs found in GRUB.
>
> This issue may cause either an infinite loop at startup when
> accessing certain valid NTFS file systems, or may cause a crash
> due to a NULL pointer deference on systems where "NULL" address
> is invalid (such as may happen when calling grub-mount from
> the operating system level).
>
> Correct this issue by checking that at->attr_cur != NULL inside
> find_attr.
>
> Fixes: https://urldefense.com/v3/__https://savannah.gnu.org/bugs/?66855__;!!ACWV5N9M2RV99hQ!MlJos-JMiQzMR6XYrdHvoK1BCnCXRxxGUcBEZNXYJRmSe_ADsCWVO0Yzdk8RkShkoHuN6MBOT4mvwvWNMvBT$
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
>
> Co-authored-by: B Horn <b@horn.uk>
> Co-authored-by: Andrew Hamilton <adhamilt@gmail.com>
> Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
> ---
> grub-core/fs/ntfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/grub-core/fs/ntfs.c b/grub-core/fs/ntfs.c
> index 960833a34..a29e10401 100644
> --- a/grub-core/fs/ntfs.c
> +++ b/grub-core/fs/ntfs.c
> @@ -387,7 +387,8 @@ find_attr (struct grub_ntfs_attr *at, grub_uint8_t attr)
> }
> at->attr_cur = at->attr_nxt;
> mft_end = at->mft->buf + (at->mft->data->mft_size << GRUB_NTFS_BLK_SHR);
> - while (at->attr_cur < mft_end && *at->attr_cur != 0xFF)
> + while (at->attr_cur != NULL && at->attr_cur < mft_end
> + && *at->attr_cur != 0xFF)
> {
> at->attr_nxt = next_attribute (at->attr_cur, at->end);
> if (*at->attr_cur == GRUB_NTFS_AT_ATTRIBUTE_LIST)
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
prev parent reply other threads:[~2025-03-21 18:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-20 22:54 [PATCH v2] fs/ntfs: Check at->attr_cur after calling next_attribute() Andrew Hamilton
2025-03-20 23:04 ` Vladimir 'phcoder' Serbinenko
2025-03-20 23:19 ` Andrew Hamilton
2025-03-21 18:58 ` Ross Philipson via Grub-devel [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=325b05c4-d64b-44ed-a3e9-4df8d28aa717@oracle.com \
--to=grub-devel@gnu.org \
--cc=adhamilt@gmail.com \
--cc=andreas.klauer@metamorpher.de \
--cc=b@horn.uk \
--cc=dkiper@net-space.pl \
--cc=eric.valette@gmail.com \
--cc=fzielcke@z-51.de \
--cc=mate.kukri@canonical.com \
--cc=mlewando@redhat.com \
--cc=phcoder@gmail.com \
--cc=ross.philipson@oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.