public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: "Marvin Häuser" <mhaeuser@posteo.de>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>
Subject: Re: [PATCH 1/1] Ext4Pkg: Sanity check the inode size
Date: Sun, 7 Aug 2022 15:29:35 +0100	[thread overview]
Message-ID: <CAKbZUD3iPj0J77OLnmK1Rr9exzm8UYp9439pT3o+JVM3a_-LYA@mail.gmail.com> (raw)
In-Reply-To: <CE5BC1EA-051E-414A-B408-0C7F31570662@posteo.de>

[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]

Pushed as 436a861
<https://github.com/tianocore/edk2-platforms/commit/436a8612ae96eecbb91ec13eaf3a281366c95af1>

On Sun, Aug 7, 2022 at 7:27 AM Marvin Häuser <mhaeuser@posteo.de> wrote:

> Reviewed-by: Marvin Häuser <mhaeuser@posteo.de>
>
> > On 7. Aug 2022, at 01:39, Pedro Falcato <pedro.falcato@gmail.com> wrote:
> >
> > Check its alignment and value for possible bad values.
> >
> > Cc: Marvin Häuser <mhaeuser@posteo.de>
> > Signed-off-by: Pedro Falcato <pedro.falcato@gmail.com>
> > ---
> > Features/Ext4Pkg/Ext4Dxe/Superblock.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> > index c22155ba11b4..edee051c41e8 100644
> > --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> > +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
> > @@ -189,6 +189,12 @@ Ext4OpenSuperblock (
> >     Partition->FeaturesIncompat = Sb->s_feature_incompat;
> >     Partition->FeaturesRoCompat = Sb->s_feature_ro_compat;
> >     Partition->InodeSize        = Sb->s_inode_size;
> > +
> > +    // Check for proper alignment of InodeSize and that InodeSize is
> indeed larger than
> > +    // the minimum size, 128 bytes.
> > +    if (((Partition->InodeSize % 4) != 0) || (Partition->InodeSize <
> EXT4_GOOD_OLD_INODE_SIZE)) {
> > +      return EFI_VOLUME_CORRUPTED;
> > +    }
> >   } else {
> >     // GOOD_OLD_REV
> >     Partition->FeaturesCompat = Partition->FeaturesIncompat =
> Partition->FeaturesRoCompat = 0;
> > --
> > 2.37.1
> >
>
>

-- 
Pedro Falcato

[-- Attachment #2: Type: text/html, Size: 2525 bytes --]

      reply	other threads:[~2022-08-07 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06 23:39 [PATCH 1/1] Ext4Pkg: Sanity check the inode size Pedro Falcato
2022-08-07  6:27 ` Marvin Häuser
2022-08-07 14:29   ` 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=CAKbZUD3iPj0J77OLnmK1Rr9exzm8UYp9439pT3o+JVM3a_-LYA@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