Skip to content

Commit d6c066f

Browse files
nefigtutIngo Molnar
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 <[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]
1 parent 286d325 commit d6c066f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)