Skip to content

Commit d6c066f

Browse files
nefigtutingomolnar
authored andcommitted
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 <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
1 parent 286d325 commit d6c066f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/firmware/efi/efivars.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ efivar_store_raw(struct efivar_entry *entry, const char *buf, size_t count)
208208
u8 *data;
209209
int err;
210210

211+
if (!entry || !buf)
212+
return -EINVAL;
213+
211214
if (in_compat_syscall()) {
212215
struct compat_efi_variable *compat;
213216

0 commit comments

Comments
 (0)