summaryrefslogtreecommitdiffstats
path: root/debian/patches/upstream/lsns-fix-netns-use.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:41:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-26 17:41:48 +0000
commit44ad8616fc71dc577a8a09be7cd05a034606feeb (patch)
tree2b6e157c29d7eae810d06ee00dd3169de654ef39 /debian/patches/upstream/lsns-fix-netns-use.patch
parentReleasing progress-linux version 2.40-6~progress7.99u1. (diff)
downloadutil-linux-44ad8616fc71dc577a8a09be7cd05a034606feeb.tar.xz
util-linux-44ad8616fc71dc577a8a09be7cd05a034606feeb.zip
Merging debian version 2.40-7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/upstream/lsns-fix-netns-use.patch')
-rw-r--r--debian/patches/upstream/lsns-fix-netns-use.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches/upstream/lsns-fix-netns-use.patch b/debian/patches/upstream/lsns-fix-netns-use.patch
new file mode 100644
index 0000000..1d1c8b6
--- /dev/null
+++ b/debian/patches/upstream/lsns-fix-netns-use.patch
@@ -0,0 +1,33 @@
+From: Karel Zak <kzak@redhat.com>
+Date: Mon, 22 Apr 2024 14:28:52 +0200
+Subject: lsns: fix netns use
+
+ # ip netns add vpn
+ # lsns -T -t net
+ Segmentation fault (core dumped)
+
+The function interpolate_missing_namespaces() reads data from /proc.
+However, in the case of a persistent namespace, there is no procfs
+entry for the namespace. Therefore, this function should ignore it.
+
+Fixes: https://github.com/util-linux/util-linux/issues/2982
+Signed-off-by: Karel Zak <kzak@redhat.com>
+(cherry picked from commit 42880f54894c1d7fd113552ff8474566a2595a0d)
+---
+ sys-utils/lsns.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c
+index 4ea01d2..6c87c47 100644
+--- a/sys-utils/lsns.c
++++ b/sys-utils/lsns.c
+@@ -793,6 +793,9 @@ static void interpolate_missing_namespaces(struct lsns *ls, struct lsns_namespac
+ int fd_orphan, fd_missing;
+ struct stat st;
+
++ if (!orphan->proc)
++ return;
++
+ orphan->related_ns[rela] = get_namespace(ls, orphan->related_id[rela]);
+ if (orphan->related_ns[rela])
+ return;