public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464
@ 2017-11-20 13:57 Heyi Guo
  2017-11-20 13:57 ` [PATCH edk2-non-osi 1/2] Hisilicon/D0x/Sas: fix occasional exception Heyi Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heyi Guo @ 2017-11-20 13:57 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel; +Cc: Heyi Guo, Leif Lindholm, Ard Biesheuvel

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(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH edk2-non-osi 1/2] Hisilicon/D0x/Sas: fix occasional exception
  2017-11-20 13:57 [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Heyi Guo
@ 2017-11-20 13:57 ` Heyi Guo
  2017-11-20 13:57 ` [PATCH edk2-non-osi 2/2] Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes Heyi Guo
  2017-11-23 15:44 ` [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Leif Lindholm
  2 siblings, 0 replies; 4+ messages in thread
From: Heyi Guo @ 2017-11-20 13:57 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel; +Cc: Heyi Guo, Leif Lindholm, Ard Biesheuvel

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
-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH edk2-non-osi 2/2] Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes
  2017-11-20 13:57 [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Heyi Guo
  2017-11-20 13:57 ` [PATCH edk2-non-osi 1/2] Hisilicon/D0x/Sas: fix occasional exception Heyi Guo
@ 2017-11-20 13:57 ` Heyi Guo
  2017-11-23 15:44 ` [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Leif Lindholm
  2 siblings, 0 replies; 4+ messages in thread
From: Heyi Guo @ 2017-11-20 13:57 UTC (permalink / raw)
  To: linaro-uefi, edk2-devel; +Cc: Heyi Guo, Leif Lindholm, Ard Biesheuvel

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
-- 
1.9.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464
  2017-11-20 13:57 [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Heyi Guo
  2017-11-20 13:57 ` [PATCH edk2-non-osi 1/2] Hisilicon/D0x/Sas: fix occasional exception Heyi Guo
  2017-11-20 13:57 ` [PATCH edk2-non-osi 2/2] Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes Heyi Guo
@ 2017-11-23 15:44 ` Leif Lindholm
  2 siblings, 0 replies; 4+ messages in thread
From: Leif Lindholm @ 2017-11-23 15:44 UTC (permalink / raw)
  To: Heyi Guo; +Cc: linaro-uefi, edk2-devel, Ard Biesheuvel

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
> 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.

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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-23 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 13:57 [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Heyi Guo
2017-11-20 13:57 ` [PATCH edk2-non-osi 1/2] Hisilicon/D0x/Sas: fix occasional exception Heyi Guo
2017-11-20 13:57 ` [PATCH edk2-non-osi 2/2] Hisilicon/LpcSerialPortLib: return SUCCESS for SetAttributes Heyi Guo
2017-11-23 15:44 ` [PATCH edk2-non-osi 0/2] Fix Linaro RP bug 3464 Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox