[edk2] [PATCH] OvmfPkg/QemuVideoDxe: handle invalid BltOperation gracefully

Laszlo Ersek posted 1 patch 6 years, 1 month ago
Failed in applying to current master (apply log)
OvmfPkg/QemuVideoDxe/Gop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [PATCH] OvmfPkg/QemuVideoDxe: handle invalid BltOperation gracefully
Posted by Laszlo Ersek 6 years, 1 month ago
According to the UEFI spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is supposed
to catch an invalid BltOperation, and report it with
EFI_INVALID_PARAMETER.

Remove the assertion from QemuVideoGraphicsOutputBlt() that prevents this
from working in NOOPT and DEBUG builds.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Rocky <xingrong.ni@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Reported-by: Rocky <xingrong.ni@intel.com>
Analyzed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=897
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    Repo:   https://github.com/lersek/edk2.git
    Branch: qemuvideo_invalid_bltop

 OvmfPkg/QemuVideoDxe/Gop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index b479d24a8763..d51efc2a83d5 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -366,7 +366,7 @@ Returns:
 
   default:
     Status = EFI_INVALID_PARAMETER;
-    ASSERT (FALSE);
+    break;
   }
 
   gBS->RestoreTPL (OriginalTPL);
-- 
2.14.1.3.gb7cf6e02401b

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] OvmfPkg/QemuVideoDxe: handle invalid BltOperation gracefully
Posted by Ard Biesheuvel 6 years, 1 month ago
On 23 March 2018 at 21:57, Laszlo Ersek <lersek@redhat.com> wrote:
> According to the UEFI spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is supposed
> to catch an invalid BltOperation, and report it with
> EFI_INVALID_PARAMETER.
>
> Remove the assertion from QemuVideoGraphicsOutputBlt() that prevents this
> from working in NOOPT and DEBUG builds.
>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Rocky <xingrong.ni@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Reported-by: Rocky <xingrong.ni@intel.com>
> Analyzed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=897
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>
> Notes:
>     Repo:   https://github.com/lersek/edk2.git
>     Branch: qemuvideo_invalid_bltop
>
>  OvmfPkg/QemuVideoDxe/Gop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
> index b479d24a8763..d51efc2a83d5 100644
> --- a/OvmfPkg/QemuVideoDxe/Gop.c
> +++ b/OvmfPkg/QemuVideoDxe/Gop.c
> @@ -366,7 +366,7 @@ Returns:
>
>    default:
>      Status = EFI_INVALID_PARAMETER;
> -    ASSERT (FALSE);
> +    break;
>    }
>
>    gBS->RestoreTPL (OriginalTPL);
> --
> 2.14.1.3.gb7cf6e02401b
>
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] OvmfPkg/QemuVideoDxe: handle invalid BltOperation gracefully
Posted by Ni, Ruiyu 6 years ago
On 3/24/2018 11:52 AM, Ard Biesheuvel wrote:
> On 23 March 2018 at 21:57, Laszlo Ersek <lersek@redhat.com> wrote:
>> According to the UEFI spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is supposed
>> to catch an invalid BltOperation, and report it with
>> EFI_INVALID_PARAMETER.
>>
>> Remove the assertion from QemuVideoGraphicsOutputBlt() that prevents this
>> from working in NOOPT and DEBUG builds.
>>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Rocky <xingrong.ni@intel.com>
>> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>> Reported-by: Rocky <xingrong.ni@intel.com>
>> Analyzed-by: Ruiyu Ni <ruiyu.ni@intel.com>
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=897
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> 
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
>> ---
>>
>> Notes:
>>      Repo:   https://github.com/lersek/edk2.git
>>      Branch: qemuvideo_invalid_bltop
>>
>>   OvmfPkg/QemuVideoDxe/Gop.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
>> index b479d24a8763..d51efc2a83d5 100644
>> --- a/OvmfPkg/QemuVideoDxe/Gop.c
>> +++ b/OvmfPkg/QemuVideoDxe/Gop.c
>> @@ -366,7 +366,7 @@ Returns:
>>
>>     default:
>>       Status = EFI_INVALID_PARAMETER;
>> -    ASSERT (FALSE);
>> +    break;
>>     }
>>
>>     gBS->RestoreTPL (OriginalTPL);
>> --
>> 2.14.1.3.gb7cf6e02401b
>>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

-- 
Thanks,
Ray
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] OvmfPkg/QemuVideoDxe: handle invalid BltOperation gracefully
Posted by Laszlo Ersek 6 years ago
On 03/26/18 03:26, Ni, Ruiyu wrote:
> On 3/24/2018 11:52 AM, Ard Biesheuvel wrote:
>> On 23 March 2018 at 21:57, Laszlo Ersek <lersek@redhat.com> wrote:
>>> According to the UEFI spec, EFI_GRAPHICS_OUTPUT_PROTOCOL.Blt() is
>>> supposed
>>> to catch an invalid BltOperation, and report it with
>>> EFI_INVALID_PARAMETER.
>>>
>>> Remove the assertion from QemuVideoGraphicsOutputBlt() that prevents
>>> this
>>> from working in NOOPT and DEBUG builds.
>>>
>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> Cc: Rocky <xingrong.ni@intel.com>
>>> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
>>> Reported-by: Rocky <xingrong.ni@intel.com>
>>> Analyzed-by: Ruiyu Ni <ruiyu.ni@intel.com>
>>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=897
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>
>> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>
>>> ---
>>>
>>> Notes:
>>>      Repo:   https://github.com/lersek/edk2.git
>>>      Branch: qemuvideo_invalid_bltop
>>>
>>>   OvmfPkg/QemuVideoDxe/Gop.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
>>> index b479d24a8763..d51efc2a83d5 100644
>>> --- a/OvmfPkg/QemuVideoDxe/Gop.c
>>> +++ b/OvmfPkg/QemuVideoDxe/Gop.c
>>> @@ -366,7 +366,7 @@ Returns:
>>>
>>>     default:
>>>       Status = EFI_INVALID_PARAMETER;
>>> -    ASSERT (FALSE);
>>> +    break;
>>>     }
>>>
>>>     gBS->RestoreTPL (OriginalTPL);
>>> -- 
>>> 2.14.1.3.gb7cf6e02401b
>>>
> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> 

Thank you both, commit e1fb441624cd.

Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel