aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladis Dronov <[email protected]>2020-03-08 09:08:55 +0100
committerIngo Molnar <[email protected]>2020-03-08 09:56:48 +0100
commitd6c066fda90d578aacdf19771a027ed484a79825 (patch)
treeab96a2e295bc607151712dc103f5b1137f25e439
parent286d3250c9d6437340203fb64938bea344729a0e (diff)
efi: Add a sanity check to efivar_store_raw()
Add a sanity check to efivar_store_raw() the same way efivar_{attr,size,data}_read() and efivar_show_raw() have it. Signed-off-by: Vladis Dronov <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/firmware/efi/efivars.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 69f13bc4b931..aff3dfb4d7ba 100644
--- a/drivers/firmware/efi/efivars.c
+++ b/drivers/firmware/efi/efivars.c
@@ -208,6 +208,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
u8 *data;
int err;
+ if (!entry || !buf)
+ return -EINVAL;
+
if (in_compat_syscall()) {
struct compat_efi_variable *compat;