Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Gao, Zhichao
From: Zhang, Chao B Sent: Wednesday, June 26, 2019 9:59 AM To: devel@edk2.groups.io; Gao, Liming ; Dong, Eric ; Gao, Zhichao Cc: Ni, Ray ; Laszlo Ersek Subject: RE: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid Hi All: Is that patch to fix

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Gao, Zhichao
> -Original Message- > From: Ni, Ray > Sent: Wednesday, June 26, 2019 9:58 AM > To: Dong, Eric ; Gao, Zhichao > ; devel@edk2.groups.io > Cc: Laszlo Ersek ; Gao, Liming > Subject: RE: [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure > checked range is valid > > > > @@ -170,6 +170,7

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Zhang, Chao B
dk2.groups.io] On Behalf Of Liming Gao Sent: Wednesday, June 26, 2019 9:36 AM To: Dong, Eric ; Gao, Zhichao ; devel@edk2.groups.io Cc: Ni, Ray ; Laszlo Ersek Subject: Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid Zhichao: One generic comment,

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Ni, Ray
> > @@ -170,6 +170,7 @@ MicrocodeDetect ( > > /// Check overflow and whether TotalSize is aligned with 4 bytes. > > /// > > if ( ((UINTN)MicrocodeEntryPoint + TotalSize) > MicrocodeEnd || > > + ((UINTN)MicrocodeEntryPoint + TotalSize) < (UINTN) > > + CpuMpData->MicrocodePatch

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Liming Gao
Zhichao: One generic comment, the commit message doesn't need to include V1, V2. It is just the change description. Thanks Liming >-Original Message- >From: Dong, Eric >Sent: Wednesday, June 26, 2019 8:48 AM >To: Gao, Zhichao ; devel@edk2.groups.io >Cc: Ni, Ray ; Laszlo Ersek ; Gao, >L

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Gao, Zhichao
HI Eric, I think of the comments as blow: Check overflow and whether TotalSize is aligned with 4 bytes. ==> Check whether (MicrocodeEntryPoint + TotalSize) is in the microcode data range and whether TotalSize is aligned with 4 bytes. This is the first check of the microcode data and TotalSize m

Re: [edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Dong, Eric
Hi Zhichao, Reviewed-by: Eric Dong It's better to add some comments in the code to explain the change which make the code easy to be understood. Thanks, Eric > -Original Message- > From: Gao, Zhichao > Sent: Tuesday, June 25, 2019 11:16 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ;

[edk2-devel] [PATCH V2] UefiCpuPkg/MpInitLib: MicrocodeDetect: Ensure checked range is valid

2019-06-25 Thread Gao, Zhichao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1934 V1: Originally, the checksum part would done before verfiy the microcode data. Which meas the checksum would be done for a meaningless data. It would cause a incorrect TotalSize (the size of microcode data), then incorrect checksum and incor