[edk2] [PATCH 07/11] MdeModulePkg/UsbKb: Don't access key codes when length is wrong

2018-10-14 Thread Ruiyu Ni
Per USB HID spec, the buffer holding key codes should be 8-byte long. Today's code assumes that the key codes buffer length is 8-byte long and unconditionally accesses the key codes buffer. It's incorrect. The patch fixes the issue by returning Device Error when the length is less than 8-byte. Con

[edk2] [PATCH 09/11] MdeModulePkg/UsbMouse: Don't access key codes when length is wrong

2018-10-14 Thread Ruiyu Ni
Per USB HID spec, the buffer holding key codes should at least 3-byte long. Today's code assumes that the key codes buffer length is longer than 3-byte and unconditionally accesses the key codes buffer. It's incorrect. The patch fixes the issue by returning Device Error when the length is less than

[edk2] [PATCH 11/11] MdeModulePkg/Bus/Ufs: Ensure device not return more data than expected

2018-10-14 Thread Ruiyu Ni
From: Hao Wu This commit adds checks to make sure the UFS devices do not return more data than the driver expected. Cc: Ruiyu Ni Cc: Jiewen Yao Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu --- MdeModulePkg/Bus/Ufs/UfsBlockIoPei/UfsHci.c

[edk2] [PATCH 10/11] MdeModulePkg/UsbBus: Deny when the string descriptor length is odd

2018-10-14 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Cc: Star Zeng --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c b/MdeModulePkg/Bus/Usb/UsbBusDx

[edk2] [PATCH 08/11] MdeModulePkg/AbsPointer: Don't access key codes when length is wrong

2018-10-14 Thread Ruiyu Ni
Per USB HID spec, the buffer holding key codes should at least 3-byte long. Today's code assumes that the key codes buffer length is longer than 3-byte and unconditionally accesses the key codes buffer. It's incorrect. The patch fixes the issue by returning Device Error when the length is less than

[edk2] [PATCH 04/11] MdeModulePkg/UsbBus: Reject descriptor whose length is bad

2018-10-14 Thread Ruiyu Ni
Today's implementation doesn't check whether the length of descriptor is valid before using it. The patch fixes this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Jiewen Yao --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c | 7 +++ 1

[edk2] [PATCH 06/11] SourceLevelDebugPkg/Usb3: Make sure data from HW can fit in buffer

2018-10-14 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Hao A Wu --- .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Transfer.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunication

[edk2] [PATCH 05/11] MdeModulePkg/Usb: Make sure data from HW is no more than expected

2018-10-14 Thread Ruiyu Ni
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Cc: Star Zeng Cc: Hao A Wu --- MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c | 9 ++--- MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c | 7 --- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 9 ++--- 3

[edk2] [PATCH 03/11] MdeModulePkg/UsbBus: Fix out-of-bound read access to descriptors

2018-10-14 Thread Ruiyu Ni
Today's implementation reads the Type/Length field in the USB descriptors data without checking whether the offset to read is beyond the data boundary. The patch fixes this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Jiewen Yao ---

[edk2] [PATCH 00/11] Need to validate data from HW

2018-10-14 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1250 The patches contain logic to check the data from HW before using. It can avoid corrupted data from HW causes software behave abnormally. Hao Wu (1): MdeModulePkg/Bus/Ufs: Ensure device not return more data than expected Ruiyu Ni (10):

[edk2] [PATCH 01/11] MdeModulePkg/UsbMass: Merge UsbBoot(Read|Write)Blocks(16)

2018-10-14 Thread Ruiyu Ni
The change doesn't have functionality impact. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng --- .../Bus/Usb/UsbMassStorageDxe/UsbMassBoot.c| 248 + .../Bus/Usb/UsbMassStorageDxe/UsbMassBoot.h| 76 ++- .../B

[edk2] [PATCH 02/11] MdeModulePkg/UsbMass: Fix integer overflow when BlockSize is 1

2018-10-14 Thread Ruiyu Ni
UsbBootReadWriteBlocks() and UsbBootReadWriteBlocks16() use a UINT16 local variable to hold the value of USB_BOOT_MAX_CARRY_SIZE (=0x1) / BlockSize. When BlockSize is 1, the UINT16 local variable is set to 0x1 but the high-16 bits are truncated resulting the final value be 0. It causes the

[edk2] [PATCH v1 2/7] MdeModulePkg/UdfDxe: ASSERT for false positives of NULL ptr deref

2018-10-14 Thread Hao Wu
This commit adds ASSERTs to address false positive reports of NULL pointer dereference issues raised from static analysis with regard to function ReadDirectoryEntry(). Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu -

[edk2] [PATCH v1 7/7] MdeModulePkg/UdfDxe: Handle dead codes in FileSystemOperations.c

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1249 We found potential dead codes within File.c during the code coverage test. After manual review, we think the below ones are positive reports: A. For function GetAllocationDescriptor(): Due to the all the calling places for this function, th

[edk2] [PATCH v1 4/7] MdeModulePkg/UdfDxe: Use debug msg instead of ASSERT in UdfOpen()

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1248 Within function UdfOpen(): This commit will use debug messages instead of using ASSERT when an error occurs after calling GetFileSize(). Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.

[edk2] [PATCH v1 1/7] MdeModulePkg/UdfDxe: Use error handling for memory allocation failure

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1247 For functions DuplicateFid() and DuplicateFe(), this commit will use error handling logic instead of ASSERTs for memory allocation failure. Cc: Paulo Alcantara Cc: Ruiyu Ni Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement

[edk2] [PATCH v1 6/7] MdeModulePkg/UdfDxe: Remove dead codes in FileName.c

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1249 We found potential dead codes within File.c during the code coverage test. After manual review, we think the below ones are positive reports: A. In function MangleFileName(): FileName = TrimString (FileName); // Begin of dead codes i

[edk2] [PATCH v1 3/7] MdeModulePkg/UdfDxe: Use error handling when fail to return LSN

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1248 This commit will refine the ASSERTs in function GetLongAdLsn() and GetAllocationDescriptorLsn() when the logical sector number cannot be returned due to unrecognized media format. Error handling logic will be used for those ASSERTs. Cc: Pau

[edk2] [PATCH v1 5/7] MdeModulePkg/UdfDxe: Handle dead codes in File.c

2018-10-14 Thread Hao Wu
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1249 We found potential dead codes within File.c during the code coverage test. After manual review, we think the below ones are positive reports: A. In function UdfRead(): else if (IS_FID_DELETED_FILE (Parent->FileIdentifierDesc)) { Statu

[edk2] [PATCH v1 0/7] Code refinements in UdfDxe

2018-10-14 Thread Hao Wu
This series will refine the codes in MdeModulePkg/Universal/Disk/UdfDxe for: A. Refine asserts used for memory allocation failure and error cases that are possible to happen. Will use error handling logic for them; B. Address some dead codes within this module. Cc: Paulo Alcantara Cc: Ruiyu

[edk2] [PATCH 1/1] BaseTools: Update Makefile to exclude deleted file.

2018-10-14 Thread Marvin Häuser
GenFds/Attributes.py has been deleted in 1ad635b, but was not removed from the Python Makefile. Remove it for successful compilation on Windows. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser --- BaseTools/Source/Python/Makefile | 1 - 1 file changed, 1 del

[edk2] [Patch 2/4] UefiCpuPkg/RegisterCpuFeaturesLib.h: Add new dependence types.

2018-10-14 Thread Eric Dong
Add new core/package dependence types which consumed by different MSRs. Cc: Ruiyu Ni Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- .../Include/Library/RegisterCpuFeaturesLib.h | 25 ++ 1 file changed, 21 insertio

[edk2] [Patch 0/4] Fix performance issue caused by Set MSR task.

2018-10-14 Thread Eric Dong
In a system which has multiple cores, current set register value task costs huge times. After investigation, current set MSR task costs most of the times. Current logic uses SpinLock to let set MSR task as an single thread task for all cores. Because MSR has scope attribute which may cause GP fa

[edk2] [Patch 3/4] UefiCpuPkg/RegisterCpuFeaturesLib: Add logic to support semaphore type.

2018-10-14 Thread Eric Dong
In a system which has multiple cores, current set register value task costs huge times. After investigation, current set MSR task costs most of the times. Current logic uses SpinLock to let set MSR task as an single thread task for all cores. Because MSR has scope attribute which may cause GP fa

[edk2] [Patch 1/4] UefiCpuPkg/Include/AcpiCpuData.h: Add Semaphore related Information.

2018-10-14 Thread Eric Dong
In order to support semaphore related logic, add new definition for it. Cc: Ruiyu Ni Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/Include/AcpiCpuData.h | 23 ++- 1 file changed, 22 insertions(+), 1 deletion

[edk2] [Patch 4/4] UefiCpuPkg/PiSmmCpuDxeSmm: Add logic to support semaphore type.

2018-10-14 Thread Eric Dong
Because this driver needs to set MSRs saved in normal boot phase, sync semaphore logic from RegisterCpuFeaturesLib code which used for normal boot phase. Detail see change SHA-1: dcdf1774212d87e2d7feb36286a408ea7475fd7b for RegisterCpuFeaturesLib. Cc: Ruiyu Ni Cc: Laszlo Ersek Contributed-under

Re: [edk2] [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set

2018-10-14 Thread Wang, Jian J
Reviewed-by: Jian J Wang > -Original Message- > From: Zeng, Star > Sent: Friday, October 12, 2018 6:23 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Gao, Liming ; > Yao, Jiewen ; Wang, Jian J > Subject: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set > > REF: https:

Re: [edk2] [Patch] MdeModulePkg BrotliCustomDecompressLib: Don't build it for EBC arch

2018-10-14 Thread Zeng, Star
Reviewed-by: Star Zeng -Original Message- From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Liming Gao Sent: Thursday, October 11, 2018 1:53 PM To: edk2-devel@lists.01.org Cc: Bi, Dandan ; Zeng, Star Subject: [edk2] [Patch] MdeModulePkg BrotliCustomDecompressLib: Do

Re: [edk2] [PATCH v1 1/6] PcAtChipsetPkg: Add MMIO Support to SerialIo Lib

2018-10-14 Thread Ni, Ruiyu
On 10/12/2018 11:33 PM, Ard Biesheuvel wrote: On 12 October 2018 at 17:06, Sami Mujawar wrote: Hi Ard, I believe you are referring to MdeModulePkg\Library\BaseSerialPortLib16550\BaseSerialPortLib16550.inf I have tried using this Serial Port Library. However, this has a dependency on PciLib w

Re: [edk2] [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId set

2018-10-14 Thread Gao, Liming
Reviewed-by: Liming Gao >-Original Message- >From: Zeng, Star >Sent: Friday, October 12, 2018 6:23 PM >To: edk2-devel@lists.01.org >Cc: Zeng, Star ; Gao, Liming ; >Yao, Jiewen ; Wang, Jian J >Subject: [PATCH] MdeModulePkg PcdDxe: ASSERT PcdSetNvStoreDefaultId >set > >REF: https://bugzill

[edk2] Revert BaseTools Python3 Migration has been done at 1ccc4d895dd8d659d016efcd6ef8a48749aba1d0

2018-10-14 Thread Gao, Liming
Hi, all With the community discussion, Python3 migration is the fundamental change. It requires every developer to install Python3. Before this migration, the well communication and wide verification must be done. But now, most people is not aware of this change, and not try it. So, Python3 mi

Re: [edk2] TianoCore Community Meeting Minutes

2018-10-14 Thread stephano
On 10/12/2018 6:27 AM, Leif Lindholm wrote:> I know at least one organisation that would be prevented from using it until they had explicit approval (which could take a while), and it puts me in the position of having to keep a spare x86 machine on my desktop in order to participate. Solutions I

[edk2] [PATCH] uefi-sct/SctPkg:Enhance the EraseBlock Test

2018-10-14 Thread Eric Jin
The EraseSize in the EraseBlocks conf test should be bytes. Cover the case that the size of the data to erase is a multiple of the 'EraseLengthGranularity' value of an Erase Block Protocol instance. And check whether the data on adjacent blocks are mistakenly erased. Cc: Supreeth Venkatesh Cc: Ji

Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-14 Thread Leif Lindholm
On Sun, Oct 14, 2018 at 02:51:06PM +, Gao, Liming wrote: > Leif: > OK. I will move this patch set to edk2 staging repo for people > verification. Thats sounds like a good idea. > I will use git revert command to revert total 27 patches one by > one. Then, there will be 27 commit for t

Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-14 Thread Gao, Liming
Leif: OK. I will move this patch set to edk2 staging repo for people verification. I will use git revert command to revert total 27 patches one by one. Then, there will be 27 commit for the revert patches. Or, one commit to combine all revert patches. One commit is enough. Do you agree it?

Re: [edk2] [Patch] BaseTools/Tests: Update GNUmakefile to use python3 variable

2018-10-14 Thread Laszlo Ersek
On 10/13/18 22:40, Leif Lindholm wrote: > Hi Yonghong, > > Please revert this patch. The broken state of the master branch must > be undone, not hacked on until individual bits seem to work. > > Plese do no further work on the master branch until the contents of > the tree is identical to what it