From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web11.103371.1674830066932189408 for ; Fri, 27 Jan 2023 06:34:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=Rn/aj3eO; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 557C12405DE for ; Fri, 27 Jan 2023 15:34:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1674830065; bh=Fk0J9m8Ia94e/UVwdBdq2yyp1GLkB1kfDt7nMaeVx2Y=; h=Subject:From:Date:Cc:To:From; b=Rn/aj3eOGCZWikfeVcxDQbThNswpdQwO7MOxqslkcdROl/vh4q6HQbG10hFSEAd1I eb3ljGexizbeEQ68oJkRfQab88OOcIf8XiWNSanJ5ACZk/YpcOiD0m/oHXn1JhWeCY G5BvNp4mYmXpOFuzSgil+37LWHhlR9kc1GcWeAkTkV0Np5zMmEY+KVRval9qIO5/DZ lmnLzRXbMaRHCdJgZ7mZHYUhNJUCgKmHsztkSCWZTJBxrXKxtn6ppoybEUb/K28+XO /ld63NbeJscK0QXoEjxFGgNCnmYt6vs7T7Tpp8L5gkTOnUlEDwq3CHzzaczdDd4ukT +NcJZmKCOEzIw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P3KpS4Cb5z9rxQ; Fri, 27 Jan 2023 15:34:24 +0100 (CET) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: [edk2-platforms][PATCH v3 09/11] Ext4Pkg: Add missing exit Status in Ext4OpenDirent From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= In-Reply-To: Date: Fri, 27 Jan 2023 14:34:14 +0000 Cc: Savva Mitrofanov , devel@edk2.groups.io, Vitaly Cheptsov Message-Id: <1FC9C649-05AA-4BB7-8B08-38F5AF729437@posteo.de> References: <20230127092945.94389-1-savvamtr@gmail.com> <20230127092945.94389-10-savvamtr@gmail.com> To: Pedro Falcato Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Reviewed-by: Marvin H=C3=A4user > On 27. Jan 2023, at 15:28, Pedro Falcato = wrote: >=20 > On Fri, Jan 27, 2023 at 9:29 AM Savva Mitrofanov = wrote: >>=20 >> Missing EFI_OUT_OF_RESOURCES exit status on failed Ext4CreateDentry >> leads to NULL-pointer dereference in Ext4GetFileInfo (passing NULL >> buffer in Ext4ReadDir) >>=20 >> Cc: Marvin H=C3=A4user >> Cc: Pedro Falcato >> Cc: Vitaly Cheptsov >> Fixes: 21b1853880d5 ("Ext4Pkg: Add a directory entry tree.") >> Signed-off-by: Savva Mitrofanov >> --- >> Features/Ext4Pkg/Ext4Dxe/Directory.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >>=20 >> 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 =3D Ext4CreateDentry (FileName, Directory->Dentry); >>=20 >> - if (!File->Dentry) { >> + if (File->Dentry =3D=3D NULL) { >> + Status =3D EFI_OUT_OF_RESOURCES; >> goto Error; >> } >> } >> -- >> 2.39.0 >>=20 >=20 > Reviewed-by: Pedro Falcato >=20 > --=20 > Pedro