From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A04511A1E56 for ; Wed, 31 Aug 2016 19:19:52 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 31 Aug 2016 19:19:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,264,1470726000"; d="scan'208";a="1023392243" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 31 Aug 2016 19:19:52 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 31 Aug 2016 19:19:52 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 31 Aug 2016 19:19:51 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.109]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0248.002; Thu, 1 Sep 2016 10:19:47 +0800 From: "Yao, Jiewen" To: "Zeng, Star" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add NominalSpeed in Type 27 to black list Thread-Index: AQHSA/TFDyS0jxhZuki0zoS04VYNDKBj5qYg Date: Thu, 1 Sep 2016 02:19:46 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50385F7CBD@shsmsx102.ccr.corp.intel.com> References: <1472695267-220084-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1472695267-220084-1-git-send-email-star.zeng@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add NominalSpeed in Type 27 to black list X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Sep 2016 02:19:52 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zeng, Star > Sent: Thursday, September 1, 2016 10:01 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Yao, Jiewen > Subject: [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add > NominalSpeed in Type 27 to black list >=20 > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > .../SmbiosMeasurementDxe/SmbiosMeasurementDxe.c | 31 > ++++++++++++++-------- > 1 file changed, 20 insertions(+), 11 deletions(-) >=20 > diff --git > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurement > Dxe.c > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurement > Dxe.c > index f9e0196677a9..bc5e7464e133 100644 > --- > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurement > Dxe.c > +++ > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurement > Dxe.c > @@ -1,7 +1,7 @@ > /** @file > This driver measures SMBIOS table to TPM. >=20 > -Copyright (c) 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the BS= D > License > which accompanies this distribution. The full text of the license may b= e > found at > @@ -84,6 +84,9 @@ SMBIOS_FILTER_TABLE > mSmbiosFilterType22BlackList[] =3D { > SMBIOS_FILTER_TABLE mSmbiosFilterType23BlackList[] =3D { > {0x17, OFFSET_OF(SMBIOS_TABLE_TYPE23, ResetCount), > FIELD_SIZE_OF(SMBIOS_TABLE_TYPE23, ResetCount), 0}, > }; > +SMBIOS_FILTER_TABLE mSmbiosFilterType27BlackList[] =3D { > + {0x1B, OFFSET_OF(SMBIOS_TABLE_TYPE27, NominalSpeed), > FIELD_SIZE_OF(SMBIOS_TABLE_TYPE27, NominalSpeed), 0}, > +}; > SMBIOS_FILTER_TABLE mSmbiosFilterType39BlackList[] =3D { > {0x27, OFFSET_OF(SMBIOS_TABLE_TYPE39, SerialNumber), > FIELD_SIZE_OF(SMBIOS_TABLE_TYPE39, SerialNumber), > SMBIOS_FILTER_TABLE_FLAG_IS_STRING}, > {0x27, OFFSET_OF(SMBIOS_TABLE_TYPE39, AssetTagNumber), > FIELD_SIZE_OF(SMBIOS_TABLE_TYPE39, AssetTagNumber), > SMBIOS_FILTER_TABLE_FLAG_IS_STRING}, > @@ -101,6 +104,7 @@ SMBIOS_FILTER_STRUCT > mSmbiosFilterStandardTableBlackList[] =3D { > {0x12, NULL, 0}, > {0x16, mSmbiosFilterType22BlackList, > sizeof(mSmbiosFilterType22BlackList)/sizeof(mSmbiosFilterType22BlackList[= 0 > ])}, > {0x17, mSmbiosFilterType23BlackList, > sizeof(mSmbiosFilterType23BlackList)/sizeof(mSmbiosFilterType23BlackList[= 0 > ])}, > + {0x1B, mSmbiosFilterType27BlackList, > sizeof(mSmbiosFilterType27BlackList)/sizeof(mSmbiosFilterType27BlackList[= 0 > ])}, > {0x1F, NULL, 0}, > {0x21, NULL, 0}, > {0x27, mSmbiosFilterType39BlackList, > sizeof(mSmbiosFilterType39BlackList)/sizeof(mSmbiosFilterType39BlackList[= 0 > ])}, > @@ -281,18 +285,23 @@ FilterSmbiosEntry ( > } else { > Filter =3D FilterStruct->Filter; > for (Index =3D 0; Index < FilterStruct->FilterCount; Index++) { > - if ((Filter[Index].Flags & > SMBIOS_FILTER_TABLE_FLAG_IS_STRING) !=3D 0) { > - CopyMem (&StringId, (UINT8 *)TableEntry + Filter[Index].Offset= , > sizeof(StringId)); > - if (StringId !=3D 0) { > - // set ' ' for string field > - String =3D GetSmbiosStringById (TableEntry, StringId, > &StringLen); > - ASSERT (String !=3D NULL); > - //DEBUG ((EFI_D_INFO,"StrId(0x%x)-%a(%d)\n", StringId, > String, StringLen)); > - SetMem (String, StringLen, ' '); > + if (((SMBIOS_STRUCTURE *) TableEntry)->Length >=3D > (Filter[Index].Offset + Filter[Index].Size)) { > + // > + // The field is present in the SMBIOS entry. > + // > + if ((Filter[Index].Flags & > SMBIOS_FILTER_TABLE_FLAG_IS_STRING) !=3D 0) { > + CopyMem (&StringId, (UINT8 *)TableEntry + > Filter[Index].Offset, sizeof(StringId)); > + if (StringId !=3D 0) { > + // set ' ' for string field > + String =3D GetSmbiosStringById (TableEntry, StringId, > &StringLen); > + ASSERT (String !=3D NULL); > + //DEBUG ((EFI_D_INFO,"StrId(0x%x)-%a(%d)\n", StringId, > String, StringLen)); > + SetMem (String, StringLen, ' '); > + } > } > + // zero non-string field > + ZeroMem ((UINT8 *)TableEntry + Filter[Index].Offset, > Filter[Index].Size); > } > - // zero non-string field > - ZeroMem ((UINT8 *)TableEntry + Filter[Index].Offset, > Filter[Index].Size); > } > } > } > -- > 2.7.0.windows.1