[arch-commits] Commit in linux-lts/trunk (2 files)

Christian Hesse eworm at archlinux.org
Sat Nov 28 15:29:13 UTC 2020


    Date: Saturday, November 28, 2020 @ 15:29:13
  Author: eworm
Revision: 402361

upgpkg: linux-lts 5.4.80-2: fix oops on shutdown

Added:
  linux-lts/trunk/0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch
Modified:
  linux-lts/trunk/PKGBUILD

---------------------------------------------------------------+
 0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch |   55 ++++++++++
 PKGBUILD                                                      |    4 
 2 files changed, 58 insertions(+), 1 deletion(-)

Added: 0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch
===================================================================
--- 0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch	                        (rev 0)
+++ 0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch	2020-11-28 15:29:13 UTC (rev 402361)
@@ -0,0 +1,55 @@
+From a163474e9b86c2c25f20733385d8b1d6de492a7f Mon Sep 17 00:00:00 2001
+From: Ard Biesheuvel <ardb at kernel.org>
+Date: Wed, 25 Nov 2020 08:45:55 +0100
+Subject: efivarfs: revert "fix memory leak in efivarfs_create()"
+
+The memory leak addressed by commit fe5186cf12e3 is a false positive:
+all allocations are recorded in a linked list, and freed when the
+filesystem is unmounted. This leads to double frees, and as reported
+by David, leads to crashes if SLUB is configured to self destruct when
+double frees occur.
+
+So drop the redundant kfree() again, and instead, mark the offending
+pointer variable so the allocation is ignored by kmemleak.
+
+Cc: Vamshi K Sthambamkadi <vamshi.k.sthambamkadi at gmail.com>
+Fixes: fe5186cf12e3 ("efivarfs: fix memory leak in efivarfs_create()")
+Reported-by: David Laight <David.Laight at aculab.com>
+Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
+---
+ fs/efivarfs/inode.c | 2 ++
+ fs/efivarfs/super.c | 1 -
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c
+index 96c0c86f3fff..0297ad95eb5c 100644
+--- a/fs/efivarfs/inode.c
++++ b/fs/efivarfs/inode.c
+@@ -7,6 +7,7 @@
+ #include <linux/efi.h>
+ #include <linux/fs.h>
+ #include <linux/ctype.h>
++#include <linux/kmemleak.h>
+ #include <linux/slab.h>
+ #include <linux/uuid.h>
+ 
+@@ -103,6 +104,7 @@ static int efivarfs_create(struct inode *dir, struct dentry *dentry,
+ 	var->var.VariableName[i] = '\0';
+ 
+ 	inode->i_private = var;
++	kmemleak_ignore(var);
+ 
+ 	err = efivar_entry_add(var, &efivarfs_list);
+ 	if (err)
+diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
+index f943fd0b0699..15880a68faad 100644
+--- a/fs/efivarfs/super.c
++++ b/fs/efivarfs/super.c
+@@ -21,7 +21,6 @@ LIST_HEAD(efivarfs_list);
+ static void efivarfs_evict_inode(struct inode *inode)
+ {
+ 	clear_inode(inode);
+-	kfree(inode->i_private);
+ }
+ 
+ static const struct super_operations efivarfs_ops = {

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-11-28 14:29:07 UTC (rev 402360)
+++ PKGBUILD	2020-11-28 15:29:13 UTC (rev 402361)
@@ -2,7 +2,7 @@
 
 pkgbase=linux-lts
 pkgver=5.4.80
-pkgrel=1
+pkgrel=2
 pkgdesc='LTS Linux'
 url="https://www.kernel.org/"
 arch=(x86_64)
@@ -18,6 +18,7 @@
   config         # the main kernel config file
   0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch
   0002-virt-vbox-Add-support-for-the-new-VBG_IOCTL_ACQUIRE_.patch
+  0003-efivarfs-revert-fix-memory-leak-in-efivarfs_create.patch
   sphinx-workaround.patch
 )
 validpgpkeys=(
@@ -30,6 +31,7 @@
             '760ec068a7a1d8e6d4af17c2a77bd0bcec6198ba31e003f6304313d43e3632a0'
             'b439f57b84bc98730c0265695abb92385ee4dcd35a5c00d4cb3d3155c75fb491'
             '4fd74bb2a7101d700fba91806141339d8c9e46a14f8fc1fe276cfb68f1eec0f5'
+            'bc9e2f7e843a8fa87da0b1b40c7257cd92311f070fb255120c405ad257cff3ed'
             'b7c814c8183e4645947a6dcc3cbf80431de8a8fd4e895b780f9a5fd92f82cb8e')
 
 export KBUILD_BUILD_HOST=archlinux



More information about the arch-commits mailing list