diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-01-15 10:30:44 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-01-15 10:30:44 +0000 |
commit | e0794be8a0d11e90461e5a9c85012a36b93ec976 (patch) | |
tree | efd9cbc55ea3322867bf601c4d536758a3dd5fcc /nixpkgs/pkgs/development/libraries/glibc | |
parent | 3538874082ded7647b1ccec0343c7c1e882cfef3 (diff) | |
parent | 1a57d96edd156958b12782e8c8b6a374142a7248 (diff) | |
download | nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.gz nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.bz2 nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.lz nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.xz nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.tar.zst nixlib-e0794be8a0d11e90461e5a9c85012a36b93ec976.zip |
Merge commit '1a57d96edd156958b12782e8c8b6a374142a7248'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/glibc')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/glibc/2.30-cve-2020-1752.patch | 62 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/glibc/2.31-cve-2020-10029.patch | 79 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz | bin | 0 -> 24498 bytes | |||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/glibc/common.nix | 34 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch | 44 |
5 files changed, 29 insertions, 190 deletions
diff --git a/nixpkgs/pkgs/development/libraries/glibc/2.30-cve-2020-1752.patch b/nixpkgs/pkgs/development/libraries/glibc/2.30-cve-2020-1752.patch deleted file mode 100644 index 75d874b93d09..000000000000 --- a/nixpkgs/pkgs/development/libraries/glibc/2.30-cve-2020-1752.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Andreas Schwab <schwab@suse.de> -Date: Wed, 19 Feb 2020 16:21:46 +0000 (+0100) -Subject: Fix use-after-free in glob when expanding ~user (bug 25414) -X-Git-Url: https://sourceware.org/git/?p=glibc.git;a=commitdiff_plain;h=da97c6b88eb03fb834e92964b0895c2ac8d61f63;hp=dd34bce38c822b67fcc42e73969bf6699d6874b6 - -Fix use-after-free in glob when expanding ~user (bug 25414) - -The value of `end_name' points into the value of `dirname', thus don't -deallocate the latter before the last use of the former. - -(cherry picked from commit ddc650e9b3dc916eab417ce9f79e67337b05035c) ---- - -diff --git a/posix/glob.c b/posix/glob.c -index e73e35c510..c6cbd0eb43 100644 ---- a/posix/glob.c -+++ b/posix/glob.c -@@ -827,31 +827,32 @@ __glob (const char *pattern, int flags, int (*errfunc) (const char *, int), - { - size_t home_len = strlen (p->pw_dir); - size_t rest_len = end_name == NULL ? 0 : strlen (end_name); -- char *d; -+ char *d, *newp; -+ bool use_alloca = glob_use_alloca (alloca_used, -+ home_len + rest_len + 1); - -- if (__glibc_unlikely (malloc_dirname)) -- free (dirname); -- malloc_dirname = 0; -- -- if (glob_use_alloca (alloca_used, home_len + rest_len + 1)) -- dirname = alloca_account (home_len + rest_len + 1, -- alloca_used); -+ if (use_alloca) -+ newp = alloca_account (home_len + rest_len + 1, alloca_used); - else - { -- dirname = malloc (home_len + rest_len + 1); -- if (dirname == NULL) -+ newp = malloc (home_len + rest_len + 1); -+ if (newp == NULL) - { - scratch_buffer_free (&pwtmpbuf); - retval = GLOB_NOSPACE; - goto out; - } -- malloc_dirname = 1; - } -- d = mempcpy (dirname, p->pw_dir, home_len); -+ d = mempcpy (newp, p->pw_dir, home_len); - if (end_name != NULL) - d = mempcpy (d, end_name, rest_len); - *d = '\0'; - -+ if (__glibc_unlikely (malloc_dirname)) -+ free (dirname); -+ dirname = newp; -+ malloc_dirname = !use_alloca; -+ - dirlen = home_len + rest_len; - dirname_modified = 1; - } diff --git a/nixpkgs/pkgs/development/libraries/glibc/2.31-cve-2020-10029.patch b/nixpkgs/pkgs/development/libraries/glibc/2.31-cve-2020-10029.patch deleted file mode 100644 index 8334398e8912..000000000000 --- a/nixpkgs/pkgs/development/libraries/glibc/2.31-cve-2020-10029.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/sysdeps/ieee754/ldbl-96/Makefile b/sysdeps/ieee754/ldbl-96/Makefile -index 995e90d6da..318628aed6 100644 ---- a/sysdeps/ieee754/ldbl-96/Makefile -+++ b/sysdeps/ieee754/ldbl-96/Makefile -@@ -17,5 +17,6 @@ - # <https://www.gnu.org/licenses/>. - - ifeq ($(subdir),math) --tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 -+tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo -+CFLAGS-test-sinl-pseudo.c += -fstack-protector-all - endif -diff --git a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c -index 5f742321ae..bcdf20179f 100644 ---- a/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c -+++ b/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c -@@ -210,6 +210,18 @@ __ieee754_rem_pio2l (long double x, long double *y) - return 0; - } - -+ if ((i0 & 0x80000000) == 0) -+ { -+ /* Pseudo-zero and unnormal representations are not valid -+ representations of long double. We need to avoid stack -+ corruption in __kernel_rem_pio2, which expects input in a -+ particular normal form, but those representations do not need -+ to be consistently handled like any particular floating-point -+ value. */ -+ y[1] = y[0] = __builtin_nanl (""); -+ return 0; -+ } -+ - /* Split the 64 bits of the mantissa into three 24-bit integers - stored in a double array. */ - exp = j0 - 23; ---- /dev/null -+++ b/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c -@@ -0,0 +1,41 @@ -+/* Test sinl for pseudo-zeros and unnormals for ldbl-96 (bug 25487). -+ Copyright (C) 2020 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ <https://www.gnu.org/licenses/>. */ -+ -+#include <math.h> -+#include <math_ldbl.h> -+#include <stdint.h> -+ -+static int -+do_test (void) -+{ -+ for (int i = 0; i < 64; i++) -+ { -+ uint64_t sig = i == 63 ? 0 : 1ULL << i; -+ long double ld; -+ SET_LDOUBLE_WORDS (ld, 0x4141, -+ sig >> 32, sig & 0xffffffffULL); -+ /* The requirement is that no stack overflow occurs when the -+ pseudo-zero or unnormal goes through range reduction. */ -+ volatile long double ldr; -+ ldr = sinl (ld); -+ (void) ldr; -+ } -+ return 0; -+} -+ -+#include <support/test-driver.c> diff --git a/nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz b/nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz new file mode 100644 index 000000000000..6141f08efadb --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz Binary files differdiff --git a/nixpkgs/pkgs/development/libraries/glibc/common.nix b/nixpkgs/pkgs/development/libraries/glibc/common.nix index 0b2f34c7b765..74f8329788a5 100644 --- a/nixpkgs/pkgs/development/libraries/glibc/common.nix +++ b/nixpkgs/pkgs/development/libraries/glibc/common.nix @@ -41,9 +41,9 @@ } @ args: let - version = "2.31"; - patchSuffix = ""; - sha256 = "05zxkyz9bv3j9h0xyid1rhvh3klhsmrpkf3bcs6frvlgyr2gwilj"; + version = "2.32"; + patchSuffix = "-10"; + sha256 = "0di848ibffrnwq7g2dvgqrnn4xqhj3h96csn69q4da51ymafl9qn"; in assert withLinuxHeaders -> linuxHeaders != null; @@ -59,8 +59,14 @@ stdenv.mkDerivation ({ patches = [ - /* Have rpcgen(1) look for cpp(1) in $PATH. */ - ./rpcgen-path.patch + /* No tarballs for stable upstream branch, only https://sourceware.org/git/?p=glibc.git + and using git or something would complicate bootstrapping. + Fortunately it's not too big with 2.32-10. + $ git checkout release/2.32/master; git describe + glibc-2.32-10-g0b9460d22e + $ git show --reverse glibc-2.32.. | gzip -n -9 --rsyncable - > 2.32-10.patch.gz + */ + ./2.32-10.patch.gz /* Allow NixOS and Nix to handle the locale-archive. */ ./nix-locale-archive.patch @@ -113,8 +119,6 @@ stdenv.mkDerivation ({ }) ./fix-x64-abi.patch - ./2.30-cve-2020-1752.patch - ./2.31-cve-2020-10029.patch ] ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch; @@ -146,8 +150,6 @@ stdenv.mkDerivation ({ configureFlags = [ "-C" "--enable-add-ons" - "--enable-obsolete-nsl" - "--enable-obsolete-rpc" "--sysconfdir=/etc" "--enable-stackguard-randomization" (lib.withFeatureAs withLinuxHeaders "headers" "${linuxHeaders}/include") @@ -167,6 +169,10 @@ stdenv.mkDerivation ({ "libc_cv_as_needed=no" ] ++ lib.optional withGd "--with-gd"; + makeFlags = [ + "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" + ]; + installFlags = [ "sysconfdir=$(out)/etc" ]; outputs = [ "out" "bin" "dev" "static" ]; @@ -208,7 +214,7 @@ stdenv.mkDerivation ({ configureScript="`pwd`/../$sourceRoot/configure" ${lib.optionalString (stdenv.cc.libc != null) - ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib"'' + ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib OBJDUMP=${stdenv.cc.bintools.bintools}/bin/objdump"'' } @@ -226,7 +232,7 @@ stdenv.mkDerivation ({ doCheck = false; # fails - meta = { + meta = with lib; { homepage = "https://www.gnu.org/software/libc/"; description = "The GNU C Library"; @@ -239,10 +245,10 @@ stdenv.mkDerivation ({ most systems with the Linux kernel. ''; - license = lib.licenses.lgpl2Plus; + license = licenses.lgpl2Plus; - maintainers = [ lib.maintainers.eelco ]; - platforms = lib.platforms.linux; + maintainers = with maintainers; [ eelco ma27 ]; + platforms = platforms.linux; } // meta; } diff --git a/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch b/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch index 7b224924104b..b746e6369a07 100644 --- a/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch +++ b/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch @@ -3,10 +3,8 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) * use host version of ar, which is given by environment variable * build system uses stamp.os and stamp.oS files, which only differ in case; this fails on macOS, so replace .oS with .o_S -* libintl.h does not exist (and is not needed) on macOS - ---- glibc-2.27/Makefile.in 2018-02-01 17:17:18.000000000 +0100 -+++ glibc-2.27/Makefile.in 2019-02-15 17:38:27.022965553 +0100 +--- glibc-2.32/Makefile.in 2018-02-01 17:17:18.000000000 +0100 ++++ glibc-2.32/Makefile.in 2020-12-27 18:21:30.000000000 +0100 @@ -6,9 +6,11 @@ .PHONY: all install bench @@ -20,9 +18,9 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) LC_ALL=C; export LC_ALL; \ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ ---- glibc-2.27/Makerules 2018-02-01 17:17:18.000000000 +0100 -+++ glibc-2.27/Makerules 2019-02-15 17:43:11.196039000 +0100 -@@ -915,8 +915,8 @@ +--- glibc-2.32/Makerules 2018-02-01 17:17:18.000000000 +0100 ++++ glibc-2.32/Makerules 2020-12-27 18:21:30.000000000 +0100 +@@ -847,8 +847,8 @@ ifndef objects # Create the stamp$o files to keep the parent makefile happy. @@ -33,7 +31,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) $(make-target-directory) rm -f $@; > $@ else -@@ -927,7 +927,7 @@ +@@ -859,7 +859,7 @@ # The parent will then actually add them all to the archive in the # archive rule, below. define o-iterator-doit @@ -42,7 +40,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) endef define do-stamp $(make-target-directory) -@@ -943,14 +943,14 @@ +@@ -875,14 +875,14 @@ # on the stamp files built above. define o-iterator-doit $(common-objpfx)$(patsubst %,$(libtype$o),c): \ @@ -59,7 +57,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) ifndef subdir $(subdirs-stamps): subdir_lib; endif -@@ -961,7 +961,7 @@ +@@ -893,7 +893,7 @@ # This makes all the object files. .PHONY: objects objs libobjs extra-objs objects objs: libobjs extra-objs @@ -68,7 +66,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) extra-objs: $(addprefix $(objpfx),$(extra-objs)) # Canned sequence for building an extra library archive. -@@ -1615,7 +1615,7 @@ +@@ -1499,7 +1499,7 @@ $(rmobjs) define rmobjs $(foreach o,$(object-suffixes-for-libc), @@ -77,27 +75,3 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux) endef # Also remove the dependencies and generated source files. ---- glibc-2.27/sunrpc/rpc_main.c 2019-02-15 17:32:43.710244513 +0100 -+++ glibc-2.27/sunrpc/rpc_main.c 2019-02-15 17:23:57.139617796 +0100 -@@ -38,7 +38,9 @@ - #include <stdio.h> - #include <string.h> - #include <unistd.h> -+#ifndef __APPLE__ - #include <libintl.h> -+#endif - #include <locale.h> - #include <ctype.h> - #include <sys/types.h> ---- glibc-2.27/sunrpc/rpc_scan.c 2019-02-15 17:32:54.845490606 +0100 -+++ glibc-2.27/sunrpc/rpc_scan.c 2019-02-15 17:24:54.288066644 +0100 -@@ -37,7 +37,9 @@ - #include <stdio.h> - #include <ctype.h> - #include <string.h> -+#ifndef __APPLE__ - #include <libintl.h> -+#endif - #include "rpc_scan.h" - #include "rpc_parse.h" - #include "rpc_util.h" |