public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Georgy Yakovlev" <gyakovlev@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libnvme/files/, sys-libs/libnvme/
Date: Sun, 24 Sep 2023 19:55:39 +0000 (UTC)	[thread overview]
Message-ID: <1695585305.d1288e2fe17adb3dacd2ab3f1b415c4ed45136d4.gyakovlev@gentoo> (raw)

commit:     d1288e2fe17adb3dacd2ab3f1b415c4ed45136d4
Author:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 24 19:53:27 2023 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Sun Sep 24 19:55:05 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1288e2f

sys-libs/libnvme: revbump 1.5, add fdleak segfault free patch

This prevents udisks from crashing and holding or freezing up desktop
sessions.

Issue: https://github.com/linux-nvme/libnvme/issues/684
Issue: https://github.com/storaged-project/udisks/issues/1152
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 .../libnvme/files/libnvme-1.5-free-segfault.patch  | 36 ++++++++++++++++++++++
 ...libnvme-1.5-r1.ebuild => libnvme-1.5-r2.ebuild} |  2 ++
 2 files changed, 38 insertions(+)

diff --git a/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch b/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch
new file mode 100644
index 000000000000..a41cf380f911
--- /dev/null
+++ b/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch
@@ -0,0 +1,36 @@
+From c56910f807795528fff7ba6b81f8efcdb4babe98 Mon Sep 17 00:00:00 2001
+From: Martin Belanger <martin.belanger@dell.com>
+Date: Wed, 5 Jul 2023 10:59:25 -0400
+Subject: [PATCH] tree: missing closedir() causes fd leak for
+ "/sys/bus/pci/slots"
+
+In nvme_ctrl_lookup_phy_slot(), we are missing a closedir(), which
+causes file descriptors to leak. Also, there was a missing free()
+when the function returns with ENOMEM.
+
+Signed-off-by: Martin Belanger <martin.belanger@dell.com>
+---
+ src/nvme/tree.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/nvme/tree.c b/src/nvme/tree.c
+index a2ac0698..805eff99 100644
+--- a/src/nvme/tree.c
++++ b/src/nvme/tree.c
+@@ -1292,6 +1292,8 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address)
+ 			ret = asprintf(&path, "/sys/bus/pci/slots/%s", entry->d_name);
+ 			if (ret < 0) {
+ 				errno = ENOMEM;
++				free(target_addr);
++				closedir(slots_dir);
+ 				return NULL;
+ 			}
+ 			addr = nvme_get_attr(path, "address");
+@@ -1306,6 +1308,7 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address)
+ 		}
+ 	}
+ 	free(target_addr);
++	closedir(slots_dir);
+ 	if (found)
+ 		return strdup(entry->d_name);
+ 	return NULL;

diff --git a/sys-libs/libnvme/libnvme-1.5-r1.ebuild b/sys-libs/libnvme/libnvme-1.5-r2.ebuild
similarity index 96%
rename from sys-libs/libnvme/libnvme-1.5-r1.ebuild
rename to sys-libs/libnvme/libnvme-1.5-r2.ebuild
index 5173e9bdabf1..9e2be0abd195 100644
--- a/sys-libs/libnvme/libnvme-1.5-r1.ebuild
+++ b/sys-libs/libnvme/libnvme-1.5-r2.ebuild
@@ -32,6 +32,8 @@ BDEPEND="
 	dev-lang/swig
 "
 
+PATCHES=( "${FILESDIR}/${P}-free-segfault.patch" )
+
 src_configure() {
 	local emesonargs=(
 		-Dpython=false


             reply	other threads:[~2023-09-24 19:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-24 19:55 Georgy Yakovlev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-21 20:29 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libnvme/files/, sys-libs/libnvme/ Sam James
2024-02-06  3:05 Sam James
2025-03-10 17:11 Andreas Sturmlechner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1695585305.d1288e2fe17adb3dacd2ab3f1b415c4ed45136d4.gyakovlev@gentoo \
    --to=gyakovlev@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox