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

Marvin Häuser mhaeuser at posteo.de
Fri Jan 27 14:34:14 UTC 2023


Reviewed-by: Marvin Häuser <mhaeuser at posteo.de>

> On 27. Jan 2023, at 15:28, Pedro Falcato <pedro.falcato at gmail.com> wrote:
> 
> On Fri, Jan 27, 2023 at 9:29 AM Savva Mitrofanov <savvamtr at 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 <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>
>> ---
>> 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.falcato at gmail.com>
> 
> -- 
> Pedro



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99176): https://edk2.groups.io/g/devel/message/99176
Mute This Topic: https://groups.io/mt/96562697/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