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

On Sun, Aug 7, 2022 at 7:27 AM Marvin Häuser <[email protected]> wrote:

> Reviewed-by: Marvin Häuser <[email protected]>
>
> > On 7. Aug 2022, at 01:39, Pedro Falcato <[email protected]> wrote:
> >
> > Check its alignment and value for possible bad values.
> >
> > Cc: Marvin Häuser <[email protected]>
> > Signed-off-by: Pedro Falcato <[email protected]>
> > ---
> > 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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92183): https://edk2.groups.io/g/devel/message/92183
Mute This Topic: https://groups.io/mt/92863643/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to