From nobody Mon Nov 25 03:42: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+78167+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+78167+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1627288093; cv=none; d=zohomail.com; s=zohoarc; b=P72/sY6d2hqMe0V7QQk6ES9ZDQRrRTpFx5AEqyft6FGOMlWdrngGOEUPL+Fi5h72dx6kHsBZWELOBydYvTNHGNzm8U7HgL0me3qJhiw1kk+UWYQoN51VwOMOPwMO0AXapnvRAKi3pI0105y1PIcp7B+gdaauTZjMUkQ/odnhOok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627288093; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vz4OJabsJDvLbFa80Amx54jPbr1RG8rBPZa3QC/Dbb0=; b=UC2dBEeaJWlNHQk4xmlQIKkE+isaLGAdRdEg/Nlt1SkwEgJXlCBq0W7A7sH4DZcplgW3cVXuPBaftwgW3SwOjehCETPnmaIK9nuNLPraUK1y1LH6fhRNH02gQtpdg7RIFKIYEbnpcFLw6CsGEdxgUyBaapFivuCl/VAl1+y//1E= 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+78167+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 1627288093312183.9613573181307; Mon, 26 Jul 2021 01:28:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id JFZWYY1788612xYBJk4aA88u; Mon, 26 Jul 2021 01:28:12 -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.web08.27382.1627288092235293576 for ; Mon, 26 Jul 2021 01:28:12 -0700 X-Received: by mail-pj1-f42.google.com with SMTP id mt6so11929249pjb.1 for ; Mon, 26 Jul 2021 01:28:12 -0700 (PDT) X-Gm-Message-State: 1COrCI6A7kVJK8O3VKi6Av3Vx1787277AA= X-Google-Smtp-Source: ABdhPJwrS8+g9xdyoGcEGP5Y695Ba6VIYUv6JPcvn6lrkgITOWSHdhl6z/PxGxrKXj/lG6Ay2JMEkQ== X-Received: by 2002:a65:64c4:: with SMTP id t4mr17275994pgv.222.1627288091825; Mon, 26 Jul 2021 01:28:11 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id d15sm40863062pfl.82.2021.07.26.01.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 01:28:11 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm , Sumit Garg Cc: sakamoto.kazuhiko@socionext.com, masami.hiramatsu@linaro.org, devel@edk2.groups.io Subject: [edk2-devel] [edk2-platforms PATCH v2 1/2] Silicon/SynQuacer/OpteeRngDxe: Fix invalid parameter check Date: Mon, 26 Jul 2021 17:28:09 +0900 Message-Id: <162728808875.823177.3243304632405478704.stgit@localhost> In-Reply-To: <162728807883.823177.7600899853841894479.stgit@localhost> References: <162728807883.823177.7600899853841894479.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=1627288092; bh=cwO0eOXpjhI9Gkkv9PXSfGyCHuQknd/wDXLAGMTN+TU=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Kvn84Wr0Dct78MzIgLuZWnTInI23UHe+jcuxi5FWQqUOJqUDzV8NceWqa3QiQldr3Sq nOM3EuPlu+Gwo9ysHotGCHxI/B5Va7UikC7h+/Uay723rEX43qZnvN5jv+22JBuSKL6v5 OO/XugVAtQpoBseTVRWsP7VS2zTEbFpkyHI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627288095094100001 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." instead of "RNGValue is NULL and RNGValueLength is non-zero." This fixes the mOpteeRng::GetRNG() to check the invalid parameter case correctly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- Changes in v2: - Update changelog. --- .../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 (#78167): https://edk2.groups.io/g/devel/message/78167 Mute This Topic: https://groups.io/mt/84454412/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- From nobody Mon Nov 25 03:42: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+78168+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+78168+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1627288101; cv=none; d=zohomail.com; s=zohoarc; b=HddM0ZKOhzkyNvyYhiOyp5yXQ3UCb2k3UotlxNiV/1u/ISIIlaQayG+3mnSFDuheLGNeOn02etkZoLIsDxjmC089H8RO4D4zawJFqwcxS+zl+jdE1dYkGG3aRVbe+6fhHKoUEQ1aYuJ+d4hVx+sYJ8Rh6u1YaU63gyk+FlcR5gc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627288101; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=pmO9mtK8LaNUVvMcAhkjsQAbICvvmIBlBLXZY6xRmb8=; b=aikf6HcNd6W+rl6YLc/1Bws/TPhsud0cb8SZGxORpV5u9kvAsM6IXGKnjcvXhh4SNBSEk+4JEmfaaL3sz7FQuZPH6D1K7b2sm+HgeJpxAAgOYSwtCmTY18ch0Rbt6Fj0aShWiPAQpmr3bj8l4z3oGVsHlZcmZ+OW8d8Ww51gCaU= 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+78168+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 1627288101474954.3861329040532; Mon, 26 Jul 2021 01:28:21 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id KvpdYY1788612xOlS2PIbvsU; Mon, 26 Jul 2021 01:28:21 -0700 X-Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mx.groups.io with SMTP id smtpd.web11.27507.1627288100694840980 for ; Mon, 26 Jul 2021 01:28:20 -0700 X-Received: by mail-pl1-f172.google.com with SMTP id i10so7582786pla.3 for ; Mon, 26 Jul 2021 01:28:20 -0700 (PDT) X-Gm-Message-State: 5RIIaxalFOeruMPoLlIHmrnrx1787277AA= X-Google-Smtp-Source: ABdhPJzZJaWNKbQnZHmlZExJrqD1Nnx32QgvWr0g8s5SAbM2pAMtJbabAnD68ie0NvXmMqXbMOPHtQ== X-Received: by 2002:a17:90a:7489:: with SMTP id p9mr4558117pjk.182.1627288100310; Mon, 26 Jul 2021 01:28:20 -0700 (PDT) X-Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49]) by smtp.gmail.com with ESMTPSA id m18sm11570705pjq.32.2021.07.26.01.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 01:28:20 -0700 (PDT) From: "Masami Hiramatsu" To: Ard Biesheuvel , Leif Lindholm , Sumit Garg Cc: sakamoto.kazuhiko@socionext.com, masami.hiramatsu@linaro.org, devel@edk2.groups.io Subject: [edk2-devel] [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime Date: Mon, 26 Jul 2021 17:28:17 +0900 Message-Id: <162728809717.823177.18257352684706494891.stgit@localhost> In-Reply-To: <162728807883.823177.7600899853841894479.stgit@localhost> References: <162728807883.823177.7600899853841894479.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=1627288101; bh=7q85hMNNgB4VzN08RKeFEv0oUXvcqaJAU/CdUNwCUqc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=YPrlAX6zLSue+tCBsMpvJujtaX3Q136yc8m63fa7PcO0ZpuLc9awRBfK+8F+VxXsX6O h5k7X3VbIgkvHDILcVUJNxkEROYltYsybktDmYFC0+/9dEZUWzYuA79/iOUmpSFoLS21X I0vWlDUv0knzlyrYSWd436wboBDuyyR4/eM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1627288101791100002 Clear unsupported Nanosecond field of the EFI_TIME data structure. Without this fix, date/time commands on UEFI shell fail to set because of the invaild parameter error. This is tested on the SynQuacer DeveloperBox platform which also uses 'Pcf8563' RTC chip. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Masami Hiramatsu Reported-by: Kazuhiko Sakamoto --- Changes in v2: - Update changelog. --- .../Pcf8563RealTimeClockLib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClo= ckLib.c b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockL= ib.c index 7310fecb39..b79ea89fea 100644 --- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c +++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c @@ -117,6 +117,8 @@ LibGetTime ( return EFI_DEVICE_ERROR; } =20 + Time->Nanosecond =3D 0; + if ((DateTime.VL_seconds & PCF8563_CLOCK_INVALID) !=3D 0) { Time->Second =3D 0; Time->Minute =3D 0; -=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 (#78168): https://edk2.groups.io/g/devel/message/78168 Mute This Topic: https://groups.io/mt/84454415/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-