From 04c38e36726ca0f1a21e1b5f5a83d1e4cc6a9f53 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Mon, 2 Dec 2024 14:03:53 +0100 Subject: [PATCH 1/3] nfs-utils: update to 2.8.2 --- .../patches/musl-getservbyport.patch | 3 +- .../patches/musl-svcgssd-sysconf.patch | 103 ------------------ ...s-utils-2.7.1-define_macros_for_musl.patch | 38 ------- srcpkgs/nfs-utils/template | 6 +- 4 files changed, 4 insertions(+), 146 deletions(-) delete mode 100644 srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch delete mode 100644 srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch diff --git a/srcpkgs/nfs-utils/patches/musl-getservbyport.patch b/srcpkgs/nfs-utils/patches/musl-getservbyport.patch index 6a491d4a58ed0d..f41096ca1b3324 100644 --- a/srcpkgs/nfs-utils/patches/musl-getservbyport.patch +++ b/srcpkgs/nfs-utils/patches/musl-getservbyport.patch @@ -1,6 +1,5 @@ Musl will always return something with getservbyport so we cannot skip ports that returns non-null. - diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index fd576d9..d72a0bf 100644 --- a/utils/statd/rmtcall.c @@ -14,5 +13,5 @@ index fd576d9..d72a0bf 100644 if (se == NULL) +#endif break; - + if (retries == MAX_BRP_RETRIES) { diff --git a/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch b/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch deleted file mode 100644 index aab0e9612bf23a..00000000000000 --- a/srcpkgs/nfs-utils/patches/musl-svcgssd-sysconf.patch +++ /dev/null @@ -1,103 +0,0 @@ ---- a/support/nfsidmap/libnfsidmap.c -+++ b/support/nfsidmap/libnfsidmap.c -@@ -430,11 +430,17 @@ - - nobody_user = conf_get_str("Mapping", "Nobody-User"); - if (nobody_user) { -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETPW_R_SIZE_MAX*/ - struct passwd *buf; - struct passwd *pw = NULL; - int err; - -+ /*sysconf can return -1 when _SC_GETPW_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead -+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(sizeof(*buf) + buflen); - if (buf) { - err = getpwnam_r(nobody_user, buf, ((char *)buf) + sizeof(*buf), buflen, &pw); -@@ -451,10 +457,16 @@ - - nobody_group = conf_get_str("Mapping", "Nobody-Group"); - if (nobody_group) { -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETGR_R_SIZE_MAX*/ - struct group *buf; - struct group *gr = NULL; - int err; -+ -+ /*sysconf can return -1 when _SC_GETGR_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead -+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - buf = malloc(sizeof(*buf) + buflen); - if (buf) { ---- a/support/nfsidmap/static.c -+++ b/support/nfsidmap/static.c -@@ -98,10 +98,14 @@ - { - struct passwd *pw; - struct pwbuf *buf; -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; - char *localname; - int err; - -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(sizeof(*buf) + buflen); - if (!buf) { - err = ENOMEM; -@@ -149,9 +153,13 @@ - { - struct group *gr; - struct grbuf *buf; -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; - char *localgroup; - int err; -+ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - buf = malloc(sizeof(*buf) + buflen); - if (!buf) { ---- a/support/nfsidmap/nss.c -+++ b/support/nfsidmap/nss.c -@@ -91,9 +91,13 @@ - struct passwd *pw = NULL; - struct passwd pwbuf; - char *buf; -- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX); -+ size_t buflen = 1024; - int err = -ENOMEM; - -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; -+ - buf = malloc(buflen); - if (!buf) - goto out; -@@ -119,8 +123,12 @@ - struct group *gr = NULL; - struct group grbuf; - char *buf; -- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX); -+ size_t buflen = 1024; - int err; -+ -+ if (scbuflen > 0) -+ buflen = (size_t)scbuflen; - - if (domain == NULL) - domain = get_default_domain(); diff --git a/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch b/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch deleted file mode 100644 index df4c2db84341de..00000000000000 --- a/srcpkgs/nfs-utils/patches/nfs-utils-2.7.1-define_macros_for_musl.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/support/junction/path.c b/support/junction/path.c -index 13a14386..dd0f59a0 100644 ---- a/support/junction/path.c -+++ b/support/junction/path.c -@@ -23,6 +23,12 @@ - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt - */ - -+/* For musl */ -+#ifndef _GNU_SOURCE -+#define _GNU_SOURCE -+#endif -+#include -+ - #include - #include - -diff --git a/support/include/junction.h b/support/include/junction.h -index 7257d80b..d127dd55 100644 ---- a/support/include/junction.h -+++ b/support/include/junction.h -@@ -26,6 +26,16 @@ - #ifndef _NFS_JUNCTION_H_ - #define _NFS_JUNCTION_H_ - -+/* For musl, refered to glibc's sys/cdefs.h */ -+#ifndef __attribute_malloc__ -+#define __attribute_malloc__ __attribute__((__malloc__)) -+#endif -+ -+/* For musl, refered to glibc's sys/stat.h */ -+#ifndef ALLPERMS -+#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */ -+#endif -+ - #include - - /* diff --git a/srcpkgs/nfs-utils/template b/srcpkgs/nfs-utils/template index 60da30200b697b..2a393e9cd9d511 100644 --- a/srcpkgs/nfs-utils/template +++ b/srcpkgs/nfs-utils/template @@ -1,6 +1,6 @@ # Template file for 'nfs-utils' pkgname=nfs-utils -version=2.7.1 +version=2.8.2 revision=1 build_style=gnu-configure configure_args="--with-statduser=nobody --enable-gss --enable-nfsv4 @@ -13,14 +13,14 @@ maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://www.linux-nfs.org/" distfiles="${KERNEL_SITE}/utils/${pkgname}/${version}/${pkgname}-${version}.tar.xz" -checksum=885c948a84a58bca4148f459588f9a7369dbb40dcc466f04e455c6b10fd0aa48 +checksum=a39bbea76ac0ab9e6e8699caf3c308b6b310c20d458e8fa8606196d358e7fb15 replaces="rpcgen>=0" hostmakedepends="pkg-config libtirpc-devel rpcsvc-proto mit-krb5-devel" makedepends="libblkid-devel libmount-devel libtirpc-devel keyutils-devel libevent-devel mit-krb5-devel device-mapper-devel libcap-devel sqlite-devel - libxml2-devel" + libxml2-devel libnl3-devel" depends="rpcbind" python_version=3 conf_files="/etc/exports" From ac7cda1ccbf367f80849c1ac2ba3d7a7b4913a17 Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Wed, 11 Dec 2024 14:23:55 +0100 Subject: [PATCH 2/3] libtirpc: update to 1.3.6 --- srcpkgs/libtirpc/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/libtirpc/template b/srcpkgs/libtirpc/template index 88e331d0623942..298de5fb83c367 100644 --- a/srcpkgs/libtirpc/template +++ b/srcpkgs/libtirpc/template @@ -1,6 +1,6 @@ # Template file for 'libtirpc' pkgname=libtirpc -version=1.3.5 +version=1.3.6 revision=1 build_style=gnu-configure hostmakedepends="pkg-config mit-krb5-devel" @@ -12,7 +12,7 @@ license="BSD-3-Clause" homepage="https://sourceforge.net/projects/libtirpc/" changelog="http://git.linux-nfs.org/?p=steved/libtirpc.git;a=shortlog" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" -checksum=9b31370e5a38d3391bf37edfa22498e28fe2142467ae6be7a17c9068ec0bf12f +checksum=bbd26a8f0df5690a62a47f6aa30f797f3ef8d02560d1bc449a83066b5a1d3508 case "$XBPS_TARGET_MACHINE" in *-musl) makedepends+=" musl-legacy-compat" ;; From 0c36f9898583104d8e02a4488eb10a518ceeae7d Mon Sep 17 00:00:00 2001 From: Mateusz Sylwestrzak Date: Wed, 11 Dec 2024 14:31:37 +0100 Subject: [PATCH 3/3] rpcbind: revbump for libtirpc --- srcpkgs/rpcbind/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/rpcbind/template b/srcpkgs/rpcbind/template index d2b173fef18829..002b5f231ce653 100644 --- a/srcpkgs/rpcbind/template +++ b/srcpkgs/rpcbind/template @@ -1,7 +1,7 @@ # Template file for 'rpcbind' pkgname=rpcbind version=1.2.7 -revision=2 +revision=3 build_style=gnu-configure configure_args="--enable-warmstarts --with-statedir=/run --with-rpcuser=rpc --with-systemdsystemunitdir=no"