[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200305084041.24053-3-vdronov@redhat.com>
Date: Thu, 5 Mar 2020 09:40:40 +0100
From: Vladis Dronov <vdronov@...hat.com>
To: Ard Biesheuvel <ardb@...nel.org>, linux-efi@...r.kernel.org,
joeyli <jlee@...e.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH v3 2/3] 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>
---
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 69f13bc4b931..aff3dfb4d7ba 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;
--
2.20.1
Powered by blists - more mailing lists