On Fri, Jan 27, 2023 at 9:29 AM Savva Mitrofanov <savva...@gmail.com> wrote: > > Missing EFI_OUT_OF_RESOURCES exit status on failed Ext4CreateDentry > leads to NULL-pointer dereference in Ext4GetFileInfo (passing NULL > buffer in Ext4ReadDir) > > Cc: Marvin Häuser <mhaeu...@posteo.de> > Cc: Pedro Falcato <pedro.falc...@gmail.com> > Cc: Vitaly Cheptsov <vit9...@protonmail.com> > Fixes: 21b1853880d5 ("Ext4Pkg: Add a directory entry tree.") > Signed-off-by: Savva Mitrofanov <savva...@gmail.com> > --- > Features/Ext4Pkg/Ext4Dxe/Directory.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c > b/Features/Ext4Pkg/Ext4Dxe/Directory.c > index 2e9a58a7e329..0753a20b5377 100644 > --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c > +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c > @@ -267,7 +267,8 @@ Ext4OpenDirent ( > } else { > File->Dentry = Ext4CreateDentry (FileName, Directory->Dentry); > > - if (!File->Dentry) { > + if (File->Dentry == NULL) { > + Status = EFI_OUT_OF_RESOURCES; > goto Error; > } > } > -- > 2.39.0 >
Reviewed-by: Pedro Falcato <pedro.falc...@gmail.com> -- Pedro -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#99171): https://edk2.groups.io/g/devel/message/99171 Mute This Topic: https://groups.io/mt/96562697/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-