[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158368551265.28353.5476421599260286182.tip-bot2@tip-bot2>
Date: Sun, 08 Mar 2020 16:38:32 -0000
From: "tip-bot2 for Vladis Dronov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Vladis Dronov <vdronov@...hat.com>,
Ard Biesheuvel <ardb@...nel.org>,
Ingo Molnar <mingo@...nel.org>, <stable@...r.kernel.org>,
x86 <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: [tip: efi/urgent] efi: Add a sanity check to efivar_store_raw()
The following commit has been merged into the efi/urgent branch of tip:
Commit-ID: d6c066fda90d578aacdf19771a027ed484a79825
Gitweb: https://git.kernel.org/tip/d6c066fda90d578aacdf19771a027ed484a79825
Author: Vladis Dronov <vdronov@...hat.com>
AuthorDate: Sun, 08 Mar 2020 09:08:55 +01:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Sun, 08 Mar 2020 09:56:48 +01:00
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@...hat.com>
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Ingo Molnar <mingo@...nel.org>
Cc: <stable@...r.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
---
drivers/firmware/efi/efivars.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c
index 69f13bc..aff3dfb 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;
Powered by blists - more mailing lists