We have found 2 bugs with Linaro Reference Platform bug 3464: https://bugs.linaro.org/show_bug.cgi?id=3464 1. SAS driver might use uninitialized value which would cause system exception; 2. LpcSerialPortLib used on D03 will cause SerialDxe initialized with failure and exited immediately, which would cause no serial terminal in BDS.
Patches with binary files can also be found in https://github.com/hisilicon/OpenPlatformPkg/commits/rp-osi-bug-v4
Cc: Leif Lindholm leif.lindholm@linaro.org Cc: Ard Biesheuvel ard.biesheuvel@linaro.org
Heyi Guo (2): Hisilicon/D0x/Sas: fix occasional exception Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes
Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi | Bin 98144 -> 98112 bytes Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi | Bin 116288 -> 112832 bytes Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib | Bin 16942 -> 16950 bytes 3 files changed, 0 insertions(+), 0 deletions(-)
There is a temporary variable in SAS driver which was not initialized with SAS disk, so the value of this variable depends on the unknown stack content. Later it will be used as source buffer in gBS->CopyMem, and a translation fault exception would occur if the value is beyond valid memory address as a pointer. Details can be found in https://bugs.linaro.org/show_bug.cgi?id=3464
This patch is to fix this bug, avoiding to use uninitialized value when connecting SAS disks.
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo heyi.guo@linaro.org Cc: Leif Lindholm leif.lindholm@linaro.org Cc: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi | Bin 98144 -> 98112 bytes Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi | Bin 116288 -> 112832 bytes 2 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi b/Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi index c9b2ad6..c37b922 100644 Binary files a/Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi and b/Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi differ diff --git a/Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi b/Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi index 9a680c5..a57b8e1 100644 Binary files a/Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi and b/Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi differ
After EDK2 upgrades to 91cc526, SerialDxe will exit immediately if SerialPortLib.SetAttributes returns error, and there will be no serial port terminal in UEFI BDS. Since Hisilicon LPC serial port does not support setting attributes, we change SerialPortSetAttributes in LpcSerialPortLib to simply return SUCCESS to get around of this.
The issue can be found in https://bugs.linaro.org/show_bug.cgi?id=3464
It only affects Hisilicon D03 platform since only D03 uses LPC serial port.
Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo heyi.guo@linaro.org Cc: Leif Lindholm leif.lindholm@linaro.org Cc: Ard Biesheuvel ard.biesheuvel@linaro.org --- Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib | Bin 16942 -> 16950 bytes 1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib b/Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib index d6ce068..00c5c2f 100644 Binary files a/Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib and b/Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib differ
On Mon, Nov 20, 2017 at 09:57:20PM +0800, Heyi Guo wrote:
We have found 2 bugs with Linaro Reference Platform bug 3464: https://bugs.linaro.org/show_bug.cgi?id=3464
- SAS driver might use uninitialized value which would cause system
exception; 2. LpcSerialPortLib used on D03 will cause SerialDxe initialized with failure and exited immediately, which would cause no serial terminal in BDS.
Good descriptions in commit messages, thanks. Reviewed-by: Leif Lindholm leif.lindholm@linaro.org Series pushed as bd4078f..0b6df3e
Patches with binary files can also be found in https://github.com/hisilicon/OpenPlatformPkg/commits/rp-osi-bug-v4
Cc: Leif Lindholm leif.lindholm@linaro.org Cc: Ard Biesheuvel ard.biesheuvel@linaro.org
Heyi Guo (2): Hisilicon/D0x/Sas: fix occasional exception Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes
Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi | Bin 98144 -> 98112 bytes Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi | Bin 116288 -> 112832 bytes Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib | Bin 16942 -> 16950 bytes 3 files changed, 0 insertions(+), 0 deletions(-)
-- 1.9.1