summaryrefslogtreecommitdiff
path: root/sys-fs/zfs/files/2.2.2-no-USER_NS.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-16 14:53:46 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-16 14:53:46 +0000
commitf5588424e3182e3006f725536eebd7dc7b5bbfd4 (patch)
tree2c2ccb3df6c5e1039da984d110f02d0c2ec12cf1 /sys-fs/zfs/files/2.2.2-no-USER_NS.patch
parentd969fd257186a9d8083279276697f827331f0e46 (diff)
gentoo auto-resync : 16:12:2023 - 14:53:46
Diffstat (limited to 'sys-fs/zfs/files/2.2.2-no-USER_NS.patch')
-rw-r--r--sys-fs/zfs/files/2.2.2-no-USER_NS.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/sys-fs/zfs/files/2.2.2-no-USER_NS.patch b/sys-fs/zfs/files/2.2.2-no-USER_NS.patch
new file mode 100644
index 000000000000..b132db9d4bf6
--- /dev/null
+++ b/sys-fs/zfs/files/2.2.2-no-USER_NS.patch
@@ -0,0 +1,39 @@
+https://github.com/openzfs/zfs/issues/15241
+https://github.com/openzfs/zfs/pull/15560
+
+From e0a7ec29d91b79adfd81073f229241351ed0ae21 Mon Sep 17 00:00:00 2001
+From: Ilkka Sovanto <github@ilkka.kapsi.fi>
+Date: Wed, 22 Nov 2023 20:24:47 +0200
+Subject: [PATCH] Fix zoneid when USER_NS is disabled
+
+getzoneid() should return GLOBAL_ZONEID instead of 0 when USER_NS is disabled.
+
+Signed-off-by: Ilkka Sovanto <github@ilkka.kapsi.fi>
+--- a/lib/libspl/os/linux/zone.c
++++ b/lib/libspl/os/linux/zone.c
+@@ -42,20 +42,20 @@ getzoneid(void)
+ int c = snprintf(path, sizeof (path), "/proc/self/ns/user");
+ /* This API doesn't have any error checking... */
+ if (c < 0 || c >= sizeof (path))
+- return (0);
++ return (GLOBAL_ZONEID);
+
+ ssize_t r = readlink(path, buf, sizeof (buf) - 1);
+ if (r < 0)
+- return (0);
++ return (GLOBAL_ZONEID);
+
+ cp = strchr(buf, '[');
+ if (cp == NULL)
+- return (0);
++ return (GLOBAL_ZONEID);
+ cp++;
+
+ unsigned long n = strtoul(cp, NULL, 10);
+ if (n == ULONG_MAX && errno == ERANGE)
+- return (0);
++ return (GLOBAL_ZONEID);
+ zoneid_t z = (zoneid_t)n;
+
+ return (z);
+