public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Check arguments to be compliant with spec
@ 2022-08-24  2:31 Yuan Yu
  2022-08-24  2:31 ` [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance Yuan Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Yu @ 2022-08-24  2:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Jordan Justen, Laszlo Ersek, Anthony Perard,
	Julien Grall

Some function doesn't have certain checks to be compliant with UEFI
specification.

This series adds a check to return EFI_INVALID_PARAMETER if certain
argument is NULL.

The changes can be seen at:
https://github.com/yyu/edk2/tree/return_value_fix_v1

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>

Yuan Yu (1):
  OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance

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

-- 
2.37.2.672.g94769d06f0-goog


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

* [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance
  2022-08-24  2:31 [PATCH v1 0/1] Check arguments to be compliant with spec Yuan Yu
@ 2022-08-24  2:31 ` Yuan Yu
  2022-09-05 13:55   ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Yuan Yu @ 2022-08-24  2:31 UTC (permalink / raw)
  To: devel
  Cc: Ard Biesheuvel, Jordan Justen, Laszlo Ersek, Anthony Perard,
	Julien Grall

Per UEFI Spec 2.9, EFI_HII_CONFIG_ROUTING_PROTOCOL.RouteConfig()
should return EFI_INVALID_PARAMETERS if caller passes in a NULL for
the Configuration parameter (see 35.4 EFI HII Configuration Routing
Protocol).

Add a check to return EFI_INVALID_PARAMETERS when Configuration is NULL.

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Julien Grall <julien@xen.org>

Signed-off-by: Yuan Yu <yuanyu@google.com>
---
 OvmfPkg/PlatformDxe/Platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
index a6d459f3dfd7..83dcd2216c6d 100644
--- a/OvmfPkg/PlatformDxe/Platform.c
+++ b/OvmfPkg/PlatformDxe/Platform.c
@@ -344,7 +344,7 @@ RouteConfig (
     Configuration
     ));
 
-  if (Progress == NULL) {
+  if (Progress == NULL || Configuration == NULL) {
     return EFI_INVALID_PARAMETER;
   }
 
-- 
2.37.2.672.g94769d06f0-goog


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

* Re: [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance
  2022-08-24  2:31 ` [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance Yuan Yu
@ 2022-09-05 13:55   ` Ard Biesheuvel
  0 siblings, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2022-09-05 13:55 UTC (permalink / raw)
  To: Yuan Yu
  Cc: devel, Ard Biesheuvel, Jordan Justen, Laszlo Ersek,
	Anthony Perard, Julien Grall

On Wed, 24 Aug 2022 at 04:31, Yuan Yu <yuanyu@google.com> wrote:
>
> Per UEFI Spec 2.9, EFI_HII_CONFIG_ROUTING_PROTOCOL.RouteConfig()
> should return EFI_INVALID_PARAMETERS if caller passes in a NULL for
> the Configuration parameter (see 35.4 EFI HII Configuration Routing
> Protocol).
>
> Add a check to return EFI_INVALID_PARAMETERS when Configuration is NULL.
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Anthony Perard <anthony.perard@citrix.com>
> Cc: Julien Grall <julien@xen.org>
>
> Signed-off-by: Yuan Yu <yuanyu@google.com>
> ---
>  OvmfPkg/PlatformDxe/Platform.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/OvmfPkg/PlatformDxe/Platform.c b/OvmfPkg/PlatformDxe/Platform.c
> index a6d459f3dfd7..83dcd2216c6d 100644
> --- a/OvmfPkg/PlatformDxe/Platform.c
> +++ b/OvmfPkg/PlatformDxe/Platform.c
> @@ -344,7 +344,7 @@ RouteConfig (
>      Configuration
>      ));
>
> -  if (Progress == NULL) {
> +  if (Progress == NULL || Configuration == NULL) {
>      return EFI_INVALID_PARAMETER;
>    }
>
> --
> 2.37.2.672.g94769d06f0-goog
>

Merged as #3287

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

end of thread, other threads:[~2022-09-05 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-24  2:31 [PATCH v1 0/1] Check arguments to be compliant with spec Yuan Yu
2022-08-24  2:31 ` [PATCH v1 1/1] OvmfPkg/PlatformDxe: Check RouteConfig arguments for spec compliance Yuan Yu
2022-09-05 13:55   ` Ard Biesheuvel

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