[edk2-devel] [edk2-platforms][PATCH v4 09/12] Ext4Pkg: Add missing exit Status in Ext4OpenDirent

Savva Mitrofanov savvamtr at gmail.com
Thu Feb 2 10:21:30 UTC 2023


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 <mhaeuser at posteo.de>
Cc: Pedro Falcato <pedro.falcato at gmail.com>
Cc: Vitaly Cheptsov <vit9696 at protonmail.com>
Fixes: 21b1853880d5 ("Ext4Pkg: Add a directory entry tree.")
Signed-off-by: Savva Mitrofanov <savvamtr at gmail.com>
Reviewed-by: Pedro Falcato <pedro.falcato at gmail.com>
Reviewed-by: Marvin Häuser <mhaeuser at posteo.de>
---
 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 c7992cc72717..dee8cfc66cb7 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.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99455): https://edk2.groups.io/g/devel/message/99455
Mute This Topic: https://groups.io/mt/96697374/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list