From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 5A679AC18E2 for ; Thu, 21 Sep 2023 19:03:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Wlm3FAsvcibY6YDuBfauhnwQegt3KvpUqgaqqUjmWqo=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:Cc:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695323022; v=1; b=AGKnD9wglIahpEmOZzDN6DtoyStBziyJiRBb5mTIvhj+ameoEEiGFDOCL+2GYWRVT9pztCAG eobAP0bXfR5qpep3qh3Snpx277HTNg3dMfcwfT6kjMuFFjXTjkBth+Ah7fVm0ex8zibikWR3IAc bhBtseMnc7376tJXOd0LWdvY= X-Received: by 127.0.0.2 with SMTP id 4AhIYY7687511x3aW0XMo3Lp; Thu, 21 Sep 2023 12:03:42 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.4264.1695323021279193912 for ; Thu, 21 Sep 2023 12:03:41 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 09F6C1042; Thu, 21 Sep 2023 12:04:18 -0700 (PDT) X-Received: from [10.118.106.172] (C02F85CGML7H.austin.arm.com [10.118.106.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C467E3F67D; Thu, 21 Sep 2023 12:03:40 -0700 (PDT) Message-ID: Date: Thu, 21 Sep 2023 14:03:40 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [edk2-devel] [PATCH v2 5/6] uefi-sct/SctPkg: TCG MORLOCK Locked No Key State Test To: devel@edk2.groups.io, Abhi.Singh@arm.com References: <20230921163748.275971-1-Abhi.Singh@arm.com> <20230921163748.275971-6-Abhi.Singh@arm.com> From: "Stuart Yoder" Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen In-Reply-To: <20230921163748.275971-6-Abhi.Singh@arm.com> Precedence: Bulk 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,stuart.yoder@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JM6SEwuZ9xInDs9KBlwEYjJEx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=AGKnD9wg; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io See inline comments... On 9/21/23 11:37 AM, Abhimanyu Singh via groups.io wrote: > SCT spec: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4374 >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4419 >=20 > -Implement MemoryOverwriteRequestControlLock Locked No Key > State test cases > -Add Assertions 23 - 32 from SCT spec > -Add Test Case to MemoryOverwriteRequestFunctionTest >=20 > Cc: G Edhaya Chandran > Cc: Barton Gao > Cc: Carolyn Gjertsen > Signed-off-by: Abhi Singh > Change-Id: I298f8a0f55376b00233c9ee9c6b0262dc8869ccb > --- I think there is one test assertion missing from the code and from the SCT spec for these tests. There should be a test for the case where MemoryOverwriteRequestControlLock is locked without a key and there is an attempt to _delete_ MemoryOverwriteRequestControl. That is a different path in the firmware from writing data to the variable and should return ACCESS_DENIED. [cut] > +TCGMemoryOverwriteRequestControlLockLockedNoKeyState ( > + IN EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib, > + IN EFI_TEST_RECOVERY_LIBRARY_PROTOCOL *RecoveryLib, > + IN RESET_DATA *ResetData > + ) > +{ > + EFI_STATUS Status; > + EFI_TEST_ASSERTION Result; > + UINTN DataSize; > + UINTN MemoryOverwriteControlLockKeyValu= e; > + UINT8 MemoryOverwriteRequestControlLock= Data; > + UINT8 MemoryOverwriteRequestControlData= ; > + UINT8 MemoryOverwriteRequestControlData= Cached; > + UINT32 Attributes; > + > + if (ResetData->Step =3D=3D 0) { > + goto INITIAL_RESET; > + } else if (ResetData->Step =3D=3D 1) { > + goto MORLOCK_LOCKED_STATE; > + } > + > +INITIAL_RESET: > + // > + // Reset MORLock variable by performing a cold reset > + // > + ResetData->Step =3D 1; > + ResetData->CheckpointStep =3D LOCK_NO_KEY_STATE_TEST; > + > + Status =3D RecoveryLib->WriteResetRecord ( > + RecoveryLib, > + sizeof (RESET_DATA), > + (UINT8*)ResetData > + ); > + if (EFI_ERROR(Status)) { > + StandardLib->RecordAssertion ( > + StandardLib, > + EFI_TEST_ASSERTION_FAILED, > + gTestGenericFailureGuid, > + L"TestRecoveryLib - WriteResetRecord", > + L"%a:%d:Status - %r", > + __FILE__, > + (UINTN)__LINE__, > + Status > + ); > + return Status; > + } > + SctPrint (L"System will cold reset after 1 second..."); > + gtBS->Stall (1000000); > + gtRT->ResetSystem ( > + EfiResetCold, > + EFI_SUCCESS, > + 0, > + NULL > + ); > + > +MORLOCK_LOCKED_STATE: > + //change checkpoint to next function Nit- space after comment char. Thanks, Stuart -=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 (#108966): https://edk2.groups.io/g/devel/message/108966 Mute This Topic: https://groups.io/mt/101504340/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-