Skip to content

Commit

Permalink
efi: Add a sanity check to efivar_store_raw()
Browse files Browse the repository at this point in the history
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 <vdronov@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200305084041.24053-3-vdronov@redhat.com
Link: https://lore.kernel.org/r/20200308080859.21568-25-ardb@kernel.org
  • Loading branch information
Vladis Dronov authored and Ingo Molnar committed Mar 8, 2020
1 parent 286d325 commit d6c066f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/firmware/efi/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit d6c066f

Please sign in to comment.