sys-apps/util-linux: Fixed heap-use-after-free in lsblk
authorLars Wendler <polynomial-c@gentoo.org>
Sun, 26 May 2019 09:52:16 +0000 (11:52 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Sun, 26 May 2019 09:52:30 +0000 (11:52 +0200)
Package-Manager: Portage-2.3.67, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
sys-apps/util-linux/files/util-linux-2.34_rc1-lsblk_fix_heap_use_after_free.patch [new file with mode: 0644]
sys-apps/util-linux/util-linux-2.34_rc1.ebuild

diff --git a/sys-apps/util-linux/files/util-linux-2.34_rc1-lsblk_fix_heap_use_after_free.patch b/sys-apps/util-linux/files/util-linux-2.34_rc1-lsblk_fix_heap_use_after_free.patch
new file mode 100644 (file)
index 0000000..4129120
--- /dev/null
@@ -0,0 +1,23 @@
+From f6f8a671a9a45125b6261c08b849833bce0f39a8 Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Mon, 6 May 2019 12:39:07 +0200
+Subject: [PATCH] lsblk: fix heap-use-after-free
+
+Addresses: https://github.com/karelzak/util-linux/issues/787
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ misc-utils/lsblk.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
+index 34a6cd9ca..30d5d9b4e 100644
+--- a/misc-utils/lsblk.c
++++ b/misc-utils/lsblk.c
+@@ -1560,6 +1560,7 @@ static int process_all_devices(struct lsblk_devtree *tr)
+               if (is_maj_excluded(dev->maj) || !is_maj_included(dev->maj)) {
+                       DBG(DEV, ul_debug(" %s: ignore (by filter)", d->d_name));
+                       lsblk_devtree_remove_device(tr, dev);
++                      dev = NULL;
+                       goto next;
+               }
index b222e422b0faa631feea206cd25e9ff7fb2b3ab2..e45b41732ada4e737db2953906137eccf90576ff 100644 (file)
@@ -64,6 +64,7 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 S="${WORKDIR}/${MY_P}"
 
 PATCHES=(
+       "${FILESDIR}"/${P}-lsblk_fix_heap_use_after_free.patch
        "${FILESDIR}"/${P}-lscpu_floating_point_exception_fix.patch
 )