]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
efi: Add a sanity check to efivar_store_raw()
authorVladis Dronov <vdronov@redhat.com>
Sun, 8 Mar 2020 08:08:55 +0000 (09:08 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Wed, 18 Mar 2020 10:39:18 +0000 (11:39 +0100)
BugLink: https://bugs.launchpad.net/bugs/1867903
commit d6c066fda90d578aacdf19771a027ed484a79825 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/firmware/efi/efivars.c

index 69f13bc4b931d67ef1927ad1f82c2c547e2e1269..aff3dfb4d7ba643219254820282a4f4d903edab7 100644 (file)
@@ -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;