From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mx.groups.io with SMTP id smtpd.web11.5560.1670602276434237032 for ; Fri, 09 Dec 2022 08:11:28 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SVqgcdAE; spf=pass (domain: gmail.com, ip: 209.85.167.46, mailfrom: savvamtr@gmail.com) Received: by mail-lf1-f46.google.com with SMTP id cf42so7801958lfb.1 for ; Fri, 09 Dec 2022 08:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Pn8DuGJ78tVeQF8ngys1usugjRkKiG4lLE8LlD217TU=; b=SVqgcdAEM4YL0ev0rfTdD8LFV0rGhBHFhFd1XXEnCUuaKOF/yKA1qo52849L/PTTPI g5OBrp/fvFt6gOOx+wEx4zZDfjwtf7D51mNucmYFvRhBQmykdIOnkoNSaY4sjuX42R4Y QsPyWQi+3Iu6f3FUbBejnneEsRLenRPNNxJScRghdTWCpHpz1ZG25HQVNQiyfRnYOxpL hZoAh/VxFNpmSmb5vQcXl1X9cZqwxp6SOEvtWqGQ6VB2WP/+5gK2CWJUQ9WTt+g412Co O3rml0Z3aJUym6FPQk2XqI6qXbtNhnan3FsFpOr8IjD9XqMJfXppPT5/w70jbdQN65/w Z3Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pn8DuGJ78tVeQF8ngys1usugjRkKiG4lLE8LlD217TU=; b=jjz7++oR8wWpdmWCCUiuAqbNvxKinfx2/m9+T4MOohj5diHT7gg0HoVb18hmQM81oR 36VC6883MePDhIkwNM68gqFr0k7+SS0W69R3AL3N4ycYv15xRqiR7hpSm+ezyTbWOD24 mGrOLzjuoASQ2qJbr/UMBAAfZ5/TZ7EoFoA2s/0xp/+kz6eg83XPDegDfSqkWI6Xmlw4 N0kCYt4ULu9ZBVs1EfROmA12nSHtV5dObIAN0ErOkjC+1lwda7zvjY1NJ/vzKh4Blb+J SuvRyYGN+sCsYex4xKFqhKtLv4F8uAnT11s/v7Iepo3PuKxG0Qy8VowjDdb9IZmIQD+Q 8NnA== X-Gm-Message-State: ANoB5pkbxl9bVcAQXU6D5ARme/KdVtYr9kIekatO/PqEV7eE3gM5q/lW zj1innMglLs/YdZLtlSK7PRBqCcOjnGxcSWa X-Google-Smtp-Source: AA0mqf4GLThTMV7Qa6TXq0x50lSYn13A8gI0iJHbuEYJqIydMkPWe3mpeRHurPiM1MpP2to7OtNDZg== X-Received: by 2002:a05:6512:1698:b0:4af:ac78:2602 with SMTP id bu24-20020a056512169800b004afac782602mr2795286lfb.29.1670602287211; Fri, 09 Dec 2022 08:11:27 -0800 (PST) Return-Path: Received: from localhost.localdomain ([109.194.121.139]) by smtp.gmail.com with ESMTPSA id v5-20020a05651203a500b00492c663bba2sm318430lfp.124.2022.12.09.08.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 08:11:26 -0800 (PST) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-platforms][PATCH v1 12/12] Ext4Pkg: Add missing exit Status in Ext4OpenDirent Date: Fri, 9 Dec 2022 22:11:04 +0600 Message-Id: <20221209161104.70220-13-savvamtr@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209161104.70220-1-savvamtr@gmail.com> References: <20221209161104.70220-1-savvamtr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Directory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Directory.c b/Features/Ext4Pkg/Ext4Dx= e/Directory.c index ff476c8641e8..efdce1477246 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Directory.c +++ b/Features/Ext4Pkg/Ext4Dxe/Directory.c @@ -260,7 +260,8 @@ Ext4OpenDirent ( } else {=0D File->Dentry =3D Ext4CreateDentry (FileName, Directory->Dentry);=0D =0D - if (!File->Dentry) {=0D + if (File->Dentry =3D=3D NULL) {=0D + Status =3D EFI_OUT_OF_RESOURCES;=0D goto Error;=0D }=0D }=0D --=20 2.38.1