]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jun 2020 14:14:48 +0000 (16:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jun 2020 14:14:48 +0000 (16:14 +0200)
added patches:
efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch

queue-5.7/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch [new file with mode: 0644]
queue-5.7/series

diff --git a/queue-5.7/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch b/queue-5.7/efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch
new file mode 100644 (file)
index 0000000..db028e7
--- /dev/null
@@ -0,0 +1,39 @@
+From d8bd8c6e2cfab8b78b537715255be8d7557791c0 Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ardb@kernel.org>
+Date: Fri, 22 May 2020 18:15:49 +0200
+Subject: efi/efivars: Add missing kobject_put() in sysfs entry creation error path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ard Biesheuvel <ardb@kernel.org>
+
+commit d8bd8c6e2cfab8b78b537715255be8d7557791c0 upstream.
+
+The documentation provided by kobject_init_and_add() clearly spells out
+the need to call kobject_put() on the kobject if an error is returned.
+Add this missing call to the error path.
+
+Cc: <stable@vger.kernel.org>
+Reported-by: 亿一 <teroincn@gmail.com>
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/firmware/efi/efivars.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/firmware/efi/efivars.c
++++ b/drivers/firmware/efi/efivars.c
+@@ -522,8 +522,10 @@ efivar_create_sysfs_entry(struct efivar_
+       ret = kobject_init_and_add(&new_var->kobj, &efivar_ktype,
+                                  NULL, "%s", short_name);
+       kfree(short_name);
+-      if (ret)
++      if (ret) {
++              kobject_put(&new_var->kobj);
+               return ret;
++      }
+       kobject_uevent(&new_var->kobj, KOBJ_ADD);
+       if (efivar_entry_add(new_var, &efivar_sysfs_list)) {
index 6c567cfd6073ae7844e283480258e35b9a0a77b0..f88952c64797c5b313573bd0d4c0f4bf9fdf480e 100644 (file)
@@ -54,3 +54,4 @@ io_uring-fix-flush-req-refs-underflow.patch
 io_uring-re-set-iov-base-len-for-buffer-select-retry.patch
 io_uring-use-kvfree-in-io_sqe_buffer_register.patch
 io_uring-allow-o_nonblock-async-retry.patch
+efi-efivars-add-missing-kobject_put-in-sysfs-entry-creation-error-path.patch