diff options
| author | Jonathan Gray <[email protected]> | 2017-03-12 19:26:07 +1100 |
|---|---|---|
| committer | Alexander Graf <[email protected]> | 2017-07-03 13:54:48 +0200 |
| commit | a95343b8d3db894681dd427bc60077abc891aecc (patch) | |
| tree | 267fc263becb970124017c6618fa60b832e129e0 | |
| parent | 37a980b3fa0b0ad26b16b7b9b9dbb25b0075a06b (diff) | |
efi_loader: check CreateEvent() parameters
Add some of the invalid parameter checks described in the UEFI
specification for CreateEvent(). This does not include checking
the validity of the type and tpl parameters.
Signed-off-by: Jonathan Gray <[email protected]>
Acked-By: Heinrich Schuchardt <[email protected]>
[agraf: fix checkpatch.pl indent warning]
Signed-off-by: Alexander Graf <[email protected]>
| -rw-r--r-- | lib/efi_loader/efi_boottime.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index eb5946a9594..44bcbb14559 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -189,6 +189,16 @@ static efi_status_t EFIAPI efi_create_event( return EFI_EXIT(EFI_OUT_OF_RESOURCES); } + if (event == NULL) + return EFI_EXIT(EFI_INVALID_PARAMETER); + + if ((type & EVT_NOTIFY_SIGNAL) && (type & EVT_NOTIFY_WAIT)) + return EFI_EXIT(EFI_INVALID_PARAMETER); + + if ((type & (EVT_NOTIFY_SIGNAL|EVT_NOTIFY_WAIT)) && + notify_function == NULL) + return EFI_EXIT(EFI_INVALID_PARAMETER); + efi_event.type = type; efi_event.notify_tpl = notify_tpl; efi_event.notify_function = notify_function; |
