From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web12.3524.1594288930904889751 for ; Thu, 09 Jul 2020 03:02:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ar1w0aMf; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594288930; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VvjmV8dIFu0taNzbLAi/TkzEjSccVU3/LGnkiLDNdTI=; b=ar1w0aMfmOsSoYP+BsmfuFofX88bF7kIC5Qkz/9/XQSw+A7KxiF6pioVDkLpXSpKr9R//V 6hidAb5QJlib0cwZdD9N2LN/FvtjLiNhTbDb4hdFcktBfXEmeAu3KnJ4sSH42iUqUW6Pv/ OJ5HT8RkI+vgIv+KqvYRkuj4gAtN5pk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-Cwyr0acLO_aaSHoMhW2gpQ-1; Thu, 09 Jul 2020 06:02:04 -0400 X-MC-Unique: Cwyr0acLO_aaSHoMhW2gpQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9852A800FF1; Thu, 9 Jul 2020 10:02:02 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-104.ams2.redhat.com [10.36.114.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 031616106A; Thu, 9 Jul 2020 10:02:00 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] SecurityPkg/Tcg2PhysicalPresenceLib: Fix incorrect TCG VER comparision To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: Terry Lee , Jiewen Yao , Jian J Wang , Chao Zhang References: <20200709024647.31672-1-zhichao.gao@intel.com> From: "Laszlo Ersek" Message-ID: <280267d2-3d61-04a6-26da-96fd46ad5439@redhat.com> Date: Thu, 9 Jul 2020 12:02:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200709024647.31672-1-zhichao.gao@intel.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 07/09/20 04:46, Gao, Zhichao wrote: > From: Terry Lee > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2697 > > Tcg2PhysicalPresenceLibConstructor set the module variable > mIsTcg2PPVerLowerThan_1_3 with incorrect TCG version comparision. > > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Chao Zhang > Signed-off-by: Zhichao Gao > --- > .../SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c > index 1c46d5e69d..8afaa0a785 100644 > --- a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c > +++ b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c > @@ -387,7 +387,7 @@ Tcg2PhysicalPresenceLibConstructor ( > { > EFI_STATUS Status; > > - if (AsciiStrnCmp(PP_INF_VERSION_1_2, (CHAR8 *)PcdGetPtr(PcdTcgPhysicalPresenceInterfaceVer), sizeof(PP_INF_VERSION_1_2) - 1) <= 0) { > + if (AsciiStrnCmp(PP_INF_VERSION_1_2, (CHAR8 *)PcdGetPtr(PcdTcgPhysicalPresenceInterfaceVer), sizeof(PP_INF_VERSION_1_2) - 1) >= 0) { > mIsTcg2PPVerLowerThan_1_3 = TRUE; > } > > What is the practical impact of this bug / fix? Thanks Laszlo