From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: "Marvin Häuser" <mhaeuser@posteo.de>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
Savva Mitrofanov <savvamtr@gmail.com>
Subject: Re: [PATCH 1/1] Ext4Pkg: Redirect internal Open("..", /) to the proper "/"
Date: Mon, 30 Jan 2023 20:17:47 +0000 [thread overview]
Message-ID: <CAKbZUD2c=zTOA5Za8ZbCViwkJPqP=615ipqXF5PQzKSFEeby2Q@mail.gmail.com> (raw)
In-Reply-To: <1A2D4B07-7AD6-47B9-86FE-6B1C2C6BF4C6@posteo.de>
On Mon, Jan 30, 2023 at 7:54 PM Marvin Häuser <mhaeuser@posteo.de> wrote:
>
> Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
>
> On 30. Jan 2023, at 18:58, Pedro Falcato <pedro.falcato@gmail.com> wrote:
>
> We have been hitting many issues with ".." ASSERTing on / in internal
> code, so make sure that we direct /.. to /. This is safe.
>
> Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> Cc: Marvin Häuser <mhaeuser@posteo.de>
> Reported-by: Savva Mitrofanov <savvamtr@gmail.com>
> ---
> Features/Ext4Pkg/Ext4Dxe/Directory.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c b/Features/Ext4Pkg/Ext4Dxe/Directory.c
> index 456916453952..73d21d9f9542 100644
> --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c
> +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c
> @@ -255,7 +255,11 @@ Ext4OpenDirent (
> // Using the parent's parent's dentry
> File->Dentry = Directory->Dentry->Parent;
>
> - ASSERT (File->Dentry != NULL);
> + if (!File->Dentry) {
> + // Someone tried .. on root, so direct them to /
> + // This is an illegal EFI Open() but is possible to hit from a variety of internal code
> + File->Dentry = Directory->Dentry;
> + }
>
> Ext4RefDentry (File->Dentry);
> } else {
> --
> 2.39.0
>
>
Pushed as 878c4b13f
Thank you
--
Pedro
prev parent reply other threads:[~2023-01-30 20:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 17:58 [PATCH 1/1] Ext4Pkg: Redirect internal Open("..", /) to the proper "/" Pedro Falcato
2023-01-30 19:54 ` Marvin Häuser
2023-01-30 20:17 ` Pedro Falcato [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-list 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='CAKbZUD2c=zTOA5Za8ZbCViwkJPqP=615ipqXF5PQzKSFEeby2Q@mail.gmail.com' \
--to=devel@edk2.groups.io \
/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