~ruther/guix-local

892fa358acdd9b4d7560b18489e913b9059aa249 — Andreas Enge 5 months ago c0d1fd9
gnu: Remove glibc-2.30.

* gnu/packages/base.scm (glibc-2.30): Delete variable.
* gnu/packages/patches/glibc-2.29-supported-locales.patch,
gnu/packages/patches/glibc-CVE-2019-19126.patch,
gnu/packages/patches/glibc-CVE-2019-7309.patch,
gnu/packages/patches/glibc-CVE-2019-9169.patch: Remove files.
* gnu/local.mk (dist_patch_DATA): Unregister files.

Change-Id: Iaf2ad2ccd938780f6f90ad846d81635b07e485f5
6 files changed, 0 insertions(+), 181 deletions(-)

M gnu/local.mk
M gnu/packages/base.scm
D gnu/packages/patches/glibc-2.29-supported-locales.patch
D gnu/packages/patches/glibc-CVE-2019-19126.patch
D gnu/packages/patches/glibc-CVE-2019-7309.patch
D gnu/packages/patches/glibc-CVE-2019-9169.patch
M gnu/local.mk => gnu/local.mk +0 -4
@@ 1438,9 1438,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/glibc-2.33-riscv64-miscompilation.patch	\
  %D%/packages/patches/glibc-2.39-git-updates.patch	\
  %D%/packages/patches/glibc-2.40-dl-cache.patch		\
  %D%/packages/patches/glibc-CVE-2019-7309.patch		\
  %D%/packages/patches/glibc-CVE-2019-9169.patch		\
  %D%/packages/patches/glibc-CVE-2019-19126.patch		\
  %D%/packages/patches/glibc-2.35-CVE-2023-4911.patch	\
  %D%/packages/patches/glibc-allow-kernel-2.6.32.patch		\
  %D%/packages/patches/glibc-boot-2.16.0.patch			\


@@ 1477,7 1474,6 @@ dist_patch_DATA =						\
  %D%/packages/patches/glibc-reinstate-prlimit64-fallback.patch	\
  %D%/packages/patches/glibc-skip-c++.patch			\
  %D%/packages/patches/glibc-versioned-locpath.patch		\
  %D%/packages/patches/glibc-2.29-supported-locales.patch     	\
  %D%/packages/patches/glibc-supported-locales.patch     	\
  %D%/packages/patches/gmime-disable-tests.patch		\
  %D%/packages/patches/gmp-arm-asm-nothumb.patch		\

M gnu/packages/base.scm => gnu/packages/base.scm +0 -24
@@ 1448,30 1448,6 @@ with the Linux kernel.")
                   (("^install-others =.*$")
                    (string-append "install-others = " out "/etc/rpc\n"))))))))))))

(define-public glibc-2.30
  (package
    (inherit glibc-2.31)
    (version "2.30")
    (native-inputs
     ;; This fails with a build error in libc-tls.c when using GCC 10.  Use an
     ;; older compiler.
     (modify-inputs (package-native-inputs glibc)
       (prepend gcc-8)))
    (source (origin
              (inherit (package-source glibc))
              (uri (string-append "mirror://gnu/glibc/glibc-" version ".tar.xz"))
              (sha256
               (base32
                "1bxqpg91d02qnaz837a5kamm0f43pr1il4r9pknygywsar713i72"))
              (patches (search-patches "glibc-skip-c++.patch"
                                       "glibc-ldd-x86_64.patch"
                                       "glibc-CVE-2019-19126.patch"
                                       "glibc-hidden-visibility-ldconfig.patch"
                                       "glibc-versioned-locpath.patch"
                                       "glibc-allow-kernel-2.6.32.patch"
                                       "glibc-reinstate-prlimit64-fallback.patch"
                                       "glibc-2.29-supported-locales.patch"))))))

(define-public (make-gcc-libc base-gcc libc)
  "Return a GCC that targets LIBC."
  (package (inherit base-gcc)

D gnu/packages/patches/glibc-2.29-supported-locales.patch => gnu/packages/patches/glibc-2.29-supported-locales.patch +0 -33
@@ 1,33 0,0 @@
This patch is taken from debian's glibc package (generate-supported.mk).
It install the localedata/SUPPORTED file of the glibc. This file lists
all the supported locales of the glibc.

diff --git a/localedata/Makefile b/localedata/Makefile
index 65079f9eb8..14818f84e0 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -169,7 +169,8 @@ endif
 # Files to install.
 install-others := $(addprefix $(inst_i18ndir)/, \
 			      $(addsuffix .gz, $(charmaps)) \
-			      $(locales))
+			      $(locales)) \
+                   $(inst_i18ndir)/SUPPORTED
 
 tests: $(objdir)/iconvdata/gconv-modules
 
@@ -380,6 +381,14 @@ endif
 
 include SUPPORTED
 
+$(inst_i18ndir)/SUPPORTED: SUPPORTED $(+force)
+	for locale in $(SUPPORTED-LOCALES); do \
+		[ $$locale = true ] && continue; \
+		echo $$locale | sed 's,/, ,' >> LOCALES; \
+	done
+	$(make-target-directory)
+	$(INSTALL_DATA) LOCALES $@
+
 INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
 INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
\ No newline at end of file

D gnu/packages/patches/glibc-CVE-2019-19126.patch => gnu/packages/patches/glibc-CVE-2019-19126.patch +0 -22
@@ 1,22 0,0 @@
Fix CVE-2019-19126:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19126
https://sourceware.org/bugzilla/show_bug.cgi?id=25204

Taken from upstream:
https://sourceware.org/git/?p=glibc.git;a=commit;h=37c90e117310728a4ad1eb998c0bbe7d79c4a398

diff --git a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
index 975cbe2..df2cdfd 100644
--- a/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
+++ b/sysdeps/unix/sysv/linux/x86_64/64/dl-librecon.h
@@ -31,7 +31,8 @@
    environment variable, LD_PREFER_MAP_32BIT_EXEC.  */
 #define EXTRA_LD_ENVVARS \
   case 21:								  \
-    if (memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0)		  \
+    if (!__libc_enable_secure						  \
+	&& memcmp (envline, "PREFER_MAP_32BIT_EXEC", 21) == 0)		  \
       GLRO(dl_x86_cpu_features).feature[index_arch_Prefer_MAP_32BIT_EXEC] \
 	|= bit_arch_Prefer_MAP_32BIT_EXEC;				  \
     break;

D gnu/packages/patches/glibc-CVE-2019-7309.patch => gnu/packages/patches/glibc-CVE-2019-7309.patch +0 -76
@@ 1,76 0,0 @@
Fix <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-7309>.

Taken from this upstream commit, sans ChangeLog updates and tests:
<https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3f635fb43389b54f682fc9ed2acc0b2aaf4a923d>.

diff --git a/sysdeps/x86_64/memcmp.S b/sysdeps/x86_64/memcmp.S
index 1fc487caa5..1322bb3b92 100644
--- a/sysdeps/x86_64/memcmp.S
+++ b/sysdeps/x86_64/memcmp.S
@@ -21,14 +21,18 @@
 
 	.text
 ENTRY (memcmp)
-	test	%rdx, %rdx
+#ifdef __ILP32__
+	/* Clear the upper 32 bits.  */
+	movl	%edx, %edx
+#endif
+	test	%RDX_LP, %RDX_LP
 	jz	L(finz)
 	cmpq	$1, %rdx
-	jle	L(finr1b)
+	jbe	L(finr1b)
 	subq	%rdi, %rsi
 	movq	%rdx, %r10
 	cmpq	$32, %r10
-	jge	L(gt32)
+	jae	L(gt32)
 	/* Handle small chunks and last block of less than 32 bytes.  */
 L(small):
 	testq	$1, %r10
@@ -156,7 +160,7 @@ L(A32):
 	movq	%r11, %r10
 	andq	$-32, %r10
 	cmpq	%r10, %rdi
-        jge	L(mt16)
+        jae	L(mt16)
 	/* Pre-unroll to be ready for unrolled 64B loop.  */
 	testq	$32, %rdi
 	jz	L(A64)
@@ -178,7 +182,7 @@ L(A64):
 	movq	%r11, %r10
 	andq	$-64, %r10
 	cmpq	%r10, %rdi
-        jge	L(mt32)
+        jae	L(mt32)
 
 L(A64main):
 	movdqu    (%rdi,%rsi), %xmm0
@@ -216,7 +220,7 @@ L(mt32):
 	movq	%r11, %r10
 	andq	$-32, %r10
 	cmpq	%r10, %rdi
-        jge	L(mt16)
+        jae	L(mt16)
 
 L(A32main):
 	movdqu    (%rdi,%rsi), %xmm0
@@ -254,7 +258,7 @@ L(ATR):
 	movq	%r11, %r10
 	andq	$-32, %r10
 	cmpq	%r10, %rdi
-        jge	L(mt16)
+        jae	L(mt16)
 	testq	$16, %rdi
 	jz	L(ATR32)
 
@@ -325,7 +329,7 @@ L(ATR64main):
 	movq	%r11, %r10
 	andq	$-32, %r10
 	cmpq	%r10, %rdi
-        jge	L(mt16)
+        jae	L(mt16)
 
 L(ATR32res):
 	movdqa    (%rdi,%rsi), %xmm0

D gnu/packages/patches/glibc-CVE-2019-9169.patch => gnu/packages/patches/glibc-CVE-2019-9169.patch +0 -22
@@ 1,22 0,0 @@
Fix <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-9169>.

Taken from this upstream commit, sans ChangeLog updates:
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=583dd860d5b833037175247230a328f0050dbfe9

diff --git a/posix/regexec.c b/posix/regexec.c
index 91d5a797b8..084b1222d9 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
 	      else if (naccepted)
 		{
 		  char *buf = (char *) re_string_get_buffer (&mctx->input);
-		  if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
-			      naccepted) != 0)
+		  if (mctx->input.valid_len - *pidx < naccepted
+		      || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+				  naccepted)
+			  != 0))
 		    return -1;
 		}
 	    }