From nobody Wed May 8 18:01:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+77085+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77085+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624629979; cv=none; d=zohomail.com; s=zohoarc; b=DtUSB9mZUtCYt1EgGIaY4w341eEezI5ehxTeaEr+TJPJoS+yXpFPFB1ub49GvrWUEybAxSdPmIrWIcmslPbO0uyRMjfsnNqbPoZ4YfxyE8fMIPUxLx3sEqOuulj2RsO47NYGQNEv1az/R0zI1uNSYbz95ZcI73h0AZ4v1dsOyZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624629979; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=FFfQHWwK6T45LO8fofvWWrRfiEt4mM1N7nE2aJSyK5Y=; b=KCHdfqy9rZbzOECJDGfnfRifxe6PWqrhNyEP6HVb9gnGKRep66C/sHvTr1+mRpEBCIFSPp3oIIv8hjA87uIUO022r1Q37K2ucmjTAFV+KRs0hZwLhPmhFmY7p0PHhSutxorWSMMF36G33yjW5aLHB7bb1IVP7UmRgm3sgSZ42BM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77085+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1624629979720150.06018558235564; Fri, 25 Jun 2021 07:06:19 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id db0YYY1788612x9s1Bvi10H9; Fri, 25 Jun 2021 07:06:19 -0700 X-Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mx.groups.io with SMTP id smtpd.web12.3225.1624595212926086564 for ; Thu, 24 Jun 2021 21:26:53 -0700 X-Received: by mail-pj1-f42.google.com with SMTP id h23so4741771pjv.2 for ; Thu, 24 Jun 2021 21:26:52 -0700 (PDT) X-Gm-Message-State: rZlUI5l1FKMMPBDCcx88tLlrx1787277AA= X-Google-Smtp-Source: ABdhPJxhqgDKxYubSdOZImrfLdyQzHCUH2igWdtX754r1DYJrhcG8aGbfIsSE7F5hO6G/eN8G77zaw== X-Received: by 2002:a17:902:eac2:b029:107:b14c:423d with SMTP id p2-20020a170902eac2b0290107b14c423dmr7586264pld.77.1624595212455; Thu, 24 Jun 2021 21:26:52 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id h27sm4595794pfr.171.2021.06.24.21.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 21:26:51 -0700 (PDT) From: "????" To: Sumit Garg , Ard Biesheuvel , Leif Lindholm Cc: sakamoto.kazuhiko@socionext.com, masami.hiramatsu@linaro.org, devel@edk2.groups.io Subject: [edk2-devel] [PATCH] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Date: Fri, 25 Jun 2021 13:26:48 +0900 Message-Id: <162459520845.449299.8490358705785712108.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,masami.hiramatsu@linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1624629979; bh=4pIU9/UlE723iDXgT4LD0NTo9U/XasuAMaVFpF/c25k=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=eGACL+BIcR+x3KUK+k5N+hm32LzG7UsUuRc3IBAVkruGfrV8FfPJ2sRv+BumknP+ChK F1IimBVjLRPO305JaseeTCDpDB7pcgSI9pjuF2crvUHcJ28EXDWlfT/9GmQqxXxoP7vsl 0O8FOmYMNPy6YYg7R3tO6f2E+OOIXnQnTjw= X-ZohoMail-DKIM: pass (identity @groups.io) Fix invalid parameter case according to the UEFI spec 2.9, section 37.5 EFI_RNG_PROTOCOL.GetRNG. The spec said, "RNGValue is null or RNGValueLength is zero." Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- .../SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c b/S= ilicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c index 51c15b1b94..333a3e625c 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c +++ b/Silicon/Socionext/SynQuacer/Drivers/OpteeRngDxe/OpteeRng.c @@ -98,8 +98,7 @@ GetInfo ( @retval EFI_NOT_READY There is not enough random data availabl= e to satisfy the length requested by RNGValueLength. - @retval EFI_INVALID_PARAMETER RNGValue is NULL and RNGValueLength is - non-zero. + @retval EFI_INVALID_PARAMETER RNGValue is NULL or RNGValueLength is ze= ro. =20 **/ STATIC @@ -119,7 +118,7 @@ GetRNG ( UINTN OutSize; UINTN WaitMiliSeconds; =20 - if ((Value =3D=3D NULL) && (ValueLength !=3D 0)) { + if ((Value =3D=3D NULL) || (ValueLength =3D=3D 0)) { return EFI_INVALID_PARAMETER; } =20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77085): https://edk2.groups.io/g/devel/message/77085 Mute This Topic: https://groups.io/mt/83784781/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-