diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-06 12:55:22 +0100 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-01-23 07:56:54 +0100 |
commit | 2cfb68fd83b9998efe30d181945f478e3c68c6b6 (patch) | |
tree | 9c9b0ec483699921320c2ce48e31d82c6e9ccc7a /lib | |
parent | d33f31816f606dbdf95ae3e96ce87dfc275822cd (diff) | |
download | u-boot-2cfb68fd83b9998efe30d181945f478e3c68c6b6.tar.gz |
efi_loader: notification with TPL_APPLICATION not allowed
The UEFI specification requires event notification levels to be
> TPL_APPLICATION and <= TPL_HIGH_LEVEL.
With the patch the CreateEvent() and CreatedEventEx() services are changed
to check that the notification level is not TPL_APPLICATION.
Reference:
UEFI Specification 2.8 Errata B, table 27 "TPL Restrictions",
"Event Notification Levels"
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 18ca96791c..ce658a8e73 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -687,8 +687,15 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl, return EFI_INVALID_PARAMETER; } + /* + * The UEFI specification requires event notification levels to be + * > TPL_APPLICATION and <= TPL_HIGH_LEVEL. + * + * Parameter NotifyTpl should not be checked if it is not used. + */ if ((type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) && - (!notify_function || is_valid_tpl(notify_tpl) != EFI_SUCCESS)) + (!notify_function || is_valid_tpl(notify_tpl) != EFI_SUCCESS || + notify_tpl == TPL_APPLICATION)) return EFI_INVALID_PARAMETER; ret = efi_allocate_pool(pool_type, sizeof(struct efi_event), |