Accepting request 627715 from home:Andreas_Schwab:Factory
- Update to glibc 2.28 * The localization data for ISO 14651 is updated to match the 2016 Edition 4 release of the standard, this matches data provided by Unicode 9.0.0 * Unicode 11.0.0 Support: Character encoding, character type info, and transliteration tables are all updated to Unicode 11.0.0, using generator scripts contributed by Mike FABIAN (Red Hat) * <math.h> functions that round their results to a narrower type are added from TS 18661-1:2014 and TS 18661-3:2015 * Two grammatical forms of month names are now supported * The renameat2 function has been added, a variant of the renameat function which has a flags argument * The statx function has been added, a variant of the fstatat64 function with an additional flags argument * IDN domain names in getaddrinfo and getnameinfo now use the system libidn2 library if installed * Parsing of dynamic string tokens in DT_RPATH, DT_RUNPATH, DT_NEEDED, DT_AUXILIARY, and DT_FILTER has been expanded to support the full range of ELF gABI expressions including such constructs as '$ORIGIN$ORIGIN' (if valid) * Support for ISO C threads (ISO/IEC 9899:2011) has been added. * The nonstandard header files <libio.h> and <_G_config.h> are no longer installed * The stdio functions 'getc' and 'putc' are no longer defined as macros * All stdio functions now treat end-of-file as a sticky condition * The macros 'major', 'minor', and 'makedev' are now only available from the header <sys/sysmacros.h> * The obsolete function ustat is no longer available to newly linked binaries; the headers <ustat.h> and <sys/ustat.h> have been removed * The obsolete function nfsservctl is no longer available to newly linked OBS-URL: https://build.opensuse.org/request/show/627715 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=509
This commit is contained in:
parent
d397cd95dd
commit
c2c4c80482
@ -1,30 +0,0 @@
|
||||
2018-02-10 Dmitry V. Levin <ldv@altlinux.org>
|
||||
|
||||
[BZ #22433]
|
||||
* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h (__ptrace_request):
|
||||
Remove arm-specific PTRACE_GET_THREAD_AREA, PTRACE_GETHBPREGS,
|
||||
and PTRACE_SETHBPREGS.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
|
||||
@@ -78,18 +78,10 @@ enum __ptrace_request
|
||||
PTRACE_DETACH = 17,
|
||||
#define PT_DETACH PTRACE_DETACH
|
||||
|
||||
- PTRACE_GET_THREAD_AREA = 22,
|
||||
-
|
||||
/* Continue and stop at the next entry to or return from syscall. */
|
||||
PTRACE_SYSCALL = 24,
|
||||
#define PT_SYSCALL PTRACE_SYSCALL
|
||||
|
||||
- /* Get all hardware breakpoint registers. */
|
||||
- PTRACE_GETHBPREGS = 29,
|
||||
-
|
||||
- /* Set all hardware breakpoint registers. */
|
||||
- PTRACE_SETHBPREGS = 30,
|
||||
-
|
||||
/* Set ptrace filter options. */
|
||||
PTRACE_SETOPTIONS = 0x4200,
|
||||
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
@ -1,9 +0,0 @@
|
||||
--- x86.S
|
||||
+++ x86.S
|
||||
@@ -199,5 +199,5 @@
|
||||
#endif
|
||||
|
||||
#if defined(__ELF__) && defined(__linux__)
|
||||
-.section .note.GNU-stack,"",@progbits
|
||||
+.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
@ -1,174 +0,0 @@
|
||||
From 1c581a8364ab18a6938f3153d7bea793d06a4652 Mon Sep 17 00:00:00 2001
|
||||
From: Ludwig Nussel <ludwig.nussel@suse.de>
|
||||
Date: Thu, 25 Aug 2011 14:00:38 +0200
|
||||
Subject: [PATCH crypt_blowfish] support for sha256 and sha512
|
||||
|
||||
---
|
||||
crypt.3 | 14 +++++++++++++
|
||||
crypt_gensalt.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
wrapper.c | 23 +++++++++++++++++++++
|
||||
3 files changed, 95 insertions(+), 0 deletions(-)
|
||||
|
||||
Index: crypt_blowfish-1.3/crypt.3
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt.3
|
||||
+++ crypt_blowfish-1.3/crypt.3
|
||||
@@ -399,6 +399,20 @@ too low for the currently available hard
|
||||
.hash "$1$" "\e$1\e$[^$]{1,8}\e$[./0-9A-Za-z]{22}" unlimited 8 "" 128 "6 to 48" 1000
|
||||
.PP
|
||||
.ti -2
|
||||
+.B SHA256 based
|
||||
+.br
|
||||
+This is Ulrich Drepper's SHA256-based password hashing method originally
|
||||
+developed for Linux.
|
||||
+.hash "$5$" "\e$5\e$(rounds=[0-9]{1,9}\e$)?([./0-9A-Za-z]{1,16})?\e$[./0-9A-Za-z]{43}" unlimited 8 "" 256 "0 to 96" "1000 to 999999999 (default 5000)"
|
||||
+.PP
|
||||
+.ti -2
|
||||
+.B SHA512 based
|
||||
+.br
|
||||
+This is Ulrich Drepper's SHA512-based password hashing method originally
|
||||
+developed for Linux.
|
||||
+.hash "$6$" "\e$6\e$(rounds=[0-9]{1,9}\e$)?([./0-9A-Za-z]{1,16})?\e$[./0-9A-Za-z]{86}" unlimited 8 "" 512 "0 to 96" "1000 to 999999999 (default 5000)"
|
||||
+.PP
|
||||
+.ti -2
|
||||
.BR "OpenBSD-style Blowfish-based" " (" bcrypt )
|
||||
.br
|
||||
.B bcrypt
|
||||
Index: crypt_blowfish-1.3/crypt_gensalt.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_gensalt.c
|
||||
+++ crypt_blowfish-1.3/crypt_gensalt.c
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
+#include <stdio.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef __set_errno
|
||||
@@ -122,3 +123,60 @@ char *_crypt_gensalt_md5_rn(const char *
|
||||
|
||||
return output;
|
||||
}
|
||||
+
|
||||
+#define SHA2_SALT_LEN_MAX 16
|
||||
+#define SHA2_ROUNDS_MIN 1000
|
||||
+#define SHA2_ROUNDS_MAX 999999999
|
||||
+char *_crypt_gensalt_sha2_rn (const char *prefix, unsigned long count,
|
||||
+ const char *input, int size, char *output, int output_size)
|
||||
+
|
||||
+{
|
||||
+ char *o = output;
|
||||
+ const char *i = input;
|
||||
+ unsigned needed = 3 + MIN(size/3*4, SHA2_SALT_LEN_MAX) + 1;
|
||||
+
|
||||
+ if (size < 3 || output_size < needed)
|
||||
+ goto error;
|
||||
+
|
||||
+ size = MIN(size, SHA2_SALT_LEN_MAX/4*3);
|
||||
+
|
||||
+ o[0] = prefix[0];
|
||||
+ o[1] = prefix[1];
|
||||
+ o[2] = prefix[2];
|
||||
+ o += 3;
|
||||
+
|
||||
+ if (count) {
|
||||
+ count = MAX(SHA2_ROUNDS_MIN, MIN(count, SHA2_ROUNDS_MAX));
|
||||
+ int n = snprintf (o, output_size-3, "rounds=%ld$", count);
|
||||
+ if (n < 0 || n >= output_size-3)
|
||||
+ goto error;
|
||||
+ needed += n;
|
||||
+ o += n;
|
||||
+ }
|
||||
+
|
||||
+ if (output_size < needed)
|
||||
+ goto error;
|
||||
+
|
||||
+ while (size >= 3) {
|
||||
+ unsigned long value =
|
||||
+ (unsigned long)(unsigned char)i[0] |
|
||||
+ ((unsigned long)(unsigned char)i[1] << 8) |
|
||||
+ ((unsigned long)(unsigned char)i[2] << 16);
|
||||
+ o[0] = _crypt_itoa64[value & 0x3f];
|
||||
+ o[1] = _crypt_itoa64[(value >> 6) & 0x3f];
|
||||
+ o[2] = _crypt_itoa64[(value >> 12) & 0x3f];
|
||||
+ o[3] = _crypt_itoa64[(value >> 18) & 0x3f];
|
||||
+ size -= 3;
|
||||
+ i += 3;
|
||||
+ o += 3;
|
||||
+ }
|
||||
+ o[0] = '\0';
|
||||
+
|
||||
+ return output;
|
||||
+
|
||||
+error:
|
||||
+ if (output_size > 0)
|
||||
+ output[0] = '\0';
|
||||
+ errno = ENOMEM;
|
||||
+ return NULL;
|
||||
+}
|
||||
Index: crypt_blowfish-1.3/crypt_gensalt.h
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_gensalt.h
|
||||
+++ crypt_blowfish-1.3/crypt_gensalt.h
|
||||
@@ -26,5 +26,7 @@ extern char *_crypt_gensalt_extended_rn(
|
||||
const char *input, int size, char *output, int output_size);
|
||||
extern char *_crypt_gensalt_md5_rn(const char *prefix, unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
+extern char *_crypt_gensalt_sha2_rn(const char *prefix, unsigned long count,
|
||||
+ const char *input, int size, char *output, int output_size);
|
||||
|
||||
#endif
|
||||
Index: crypt_blowfish-1.3/wrapper.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/wrapper.c
|
||||
+++ crypt_blowfish-1.3/wrapper.c
|
||||
@@ -50,6 +50,10 @@
|
||||
#include "crypt.h"
|
||||
extern char *__md5_crypt_r(const char *key, const char *salt,
|
||||
char *buffer, int buflen);
|
||||
+extern char *__sha256_crypt_r (const char *key, const char *salt,
|
||||
+ char *buffer, int buflen);
|
||||
+extern char *__sha512_crypt_r (const char *key, const char *salt,
|
||||
+ char *buffer, int buflen);
|
||||
/* crypt-entry.c needs to be patched to define __des_crypt_r rather than
|
||||
* __crypt_r, and not define crypt_r and crypt at all */
|
||||
extern char *__des_crypt_r(const char *key, const char *salt,
|
||||
@@ -112,6 +116,10 @@ static char *_crypt_retval_magic(char *r
|
||||
char *__crypt_rn(__const char *key, __const char *setting,
|
||||
void *data, int size)
|
||||
{
|
||||
+ if (setting[0] == '$' && setting[1] == '6')
|
||||
+ return __sha512_crypt_r(key, setting, (char *)data, size);
|
||||
+ if (setting[0] == '$' && setting[1] == '5')
|
||||
+ return __sha256_crypt_r(key, setting, (char *)data, size);
|
||||
if (setting[0] == '$' && setting[1] == '2')
|
||||
return _crypt_blowfish_rn(key, setting, (char *)data, size);
|
||||
if (setting[0] == '$' && setting[1] == '1')
|
||||
@@ -129,6 +137,16 @@ char *__crypt_rn(__const char *key, __co
|
||||
char *__crypt_ra(__const char *key, __const char *setting,
|
||||
void **data, int *size)
|
||||
{
|
||||
+ if (setting[0] == '$' && setting[1] == '6') {
|
||||
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
||||
+ return NULL;
|
||||
+ return __sha512_crypt_r(key, setting, (char *)*data, *size);
|
||||
+ }
|
||||
+ if (setting[0] == '$' && setting[1] == '5') {
|
||||
+ if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
||||
+ return NULL;
|
||||
+ return __sha256_crypt_r(key, setting, (char *)*data, *size);
|
||||
+ }
|
||||
if (setting[0] == '$' && setting[1] == '2') {
|
||||
if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
||||
return NULL;
|
||||
@@ -210,6 +228,9 @@ char *__crypt_gensalt_rn(const char *pre
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+ if (!strncmp(prefix, "$5$", 3) || !strncmp(prefix, "$6$", 3))
|
||||
+ use = _crypt_gensalt_sha2_rn;
|
||||
+ else
|
||||
if (!strncmp(prefix, "$2a$", 4) || !strncmp(prefix, "$2b$", 4) ||
|
||||
!strncmp(prefix, "$2y$", 4))
|
||||
use = _crypt_gensalt_blowfish_rn;
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:83fa01fca6996fe8d882b7f8e9ba0305a5664936100b01481ea3c6a8ce8d72fd
|
||||
size 30310
|
@ -1,46 +0,0 @@
|
||||
Index: crypt_blowfish-1.2/crypt_blowfish.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.2.orig/crypt_blowfish.c
|
||||
+++ crypt_blowfish-1.2/crypt_blowfish.c
|
||||
@@ -81,7 +81,7 @@ typedef struct {
|
||||
* Magic IV for 64 Blowfish encryptions that we do at the end.
|
||||
* The string is "OrpheanBeholderScryDoubt" on big-endian.
|
||||
*/
|
||||
-static BF_word BF_magic_w[6] = {
|
||||
+static const BF_word BF_magic_w[6] = {
|
||||
0x4F727068, 0x65616E42, 0x65686F6C,
|
||||
0x64657253, 0x63727944, 0x6F756274
|
||||
};
|
||||
@@ -89,7 +89,7 @@ static BF_word BF_magic_w[6] = {
|
||||
/*
|
||||
* P-box and S-box tables initialized with digits of Pi.
|
||||
*/
|
||||
-static BF_ctx BF_init_state = {
|
||||
+static const BF_ctx BF_init_state = {
|
||||
{
|
||||
{
|
||||
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
|
||||
@@ -361,10 +361,10 @@ static BF_ctx BF_init_state = {
|
||||
}
|
||||
};
|
||||
|
||||
-static unsigned char BF_itoa64[64 + 1] =
|
||||
+static const unsigned char BF_itoa64[64 + 1] =
|
||||
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
|
||||
-static unsigned char BF_atoi64[0x60] = {
|
||||
+static const unsigned char BF_atoi64[0x60] = {
|
||||
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1,
|
||||
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64,
|
||||
64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
@@ -440,8 +440,8 @@ static void BF_encode(char *dst, const B
|
||||
|
||||
static void BF_swap(BF_word *x, int count)
|
||||
{
|
||||
- static int endianness_check = 1;
|
||||
- char *is_little_endian = (char *)&endianness_check;
|
||||
+ static const int endianness_check = 1;
|
||||
+ const char *is_little_endian = (const char *)&endianness_check;
|
||||
BF_word tmp;
|
||||
|
||||
if (*is_little_endian)
|
@ -1,373 +0,0 @@
|
||||
Index: crypt_blowfish-1.3/crypt_blowfish.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_blowfish.c
|
||||
+++ crypt_blowfish-1.3/crypt_blowfish.c
|
||||
@@ -877,31 +877,3 @@ char *_crypt_blowfish_rn(const char *key
|
||||
__set_errno(EINVAL); /* pretend we don't support this hash type */
|
||||
return NULL;
|
||||
}
|
||||
-
|
||||
-char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
|
||||
- const char *input, int size, char *output, int output_size)
|
||||
-{
|
||||
- if (size < 16 || output_size < 7 + 22 + 1 ||
|
||||
- (count && (count < 4 || count > 31)) ||
|
||||
- prefix[0] != '$' || prefix[1] != '2' ||
|
||||
- (prefix[2] != 'a' && prefix[2] != 'b' && prefix[2] != 'y')) {
|
||||
- if (output_size > 0) output[0] = '\0';
|
||||
- __set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- if (!count) count = 5;
|
||||
-
|
||||
- output[0] = '$';
|
||||
- output[1] = '2';
|
||||
- output[2] = prefix[2];
|
||||
- output[3] = '$';
|
||||
- output[4] = '0' + count / 10;
|
||||
- output[5] = '0' + count % 10;
|
||||
- output[6] = '$';
|
||||
-
|
||||
- BF_encode(&output[7], (const BF_word *)input, 16);
|
||||
- output[7 + 22] = '\0';
|
||||
-
|
||||
- return output;
|
||||
-}
|
||||
Index: crypt_blowfish-1.3/crypt_blowfish.h
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_blowfish.h
|
||||
+++ crypt_blowfish-1.3/crypt_blowfish.h
|
||||
@@ -20,8 +20,5 @@
|
||||
extern int _crypt_output_magic(const char *setting, char *output, int size);
|
||||
extern char *_crypt_blowfish_rn(const char *key, const char *setting,
|
||||
char *output, int size);
|
||||
-extern char *_crypt_gensalt_blowfish_rn(const char *prefix,
|
||||
- unsigned long count,
|
||||
- const char *input, int size, char *output, int output_size);
|
||||
|
||||
#endif
|
||||
Index: crypt_blowfish-1.3/crypt_gensalt.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_gensalt.c
|
||||
+++ crypt_blowfish-1.3/crypt_gensalt.c
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
+#include <sys/param.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef __set_errno
|
||||
@@ -180,3 +181,69 @@ error:
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
+
|
||||
+typedef unsigned int BF_word;
|
||||
+
|
||||
+static const unsigned char BF_itoa64[64 + 1] =
|
||||
+ "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||
+
|
||||
+static void BF_encode(char *dst, const BF_word *src, int size)
|
||||
+{
|
||||
+ const unsigned char *sptr = (const unsigned char *)src;
|
||||
+ const unsigned char *end = sptr + size;
|
||||
+ unsigned char *dptr = (unsigned char *)dst;
|
||||
+ unsigned int c1, c2;
|
||||
+
|
||||
+ do {
|
||||
+ c1 = *sptr++;
|
||||
+ *dptr++ = BF_itoa64[c1 >> 2];
|
||||
+ c1 = (c1 & 0x03) << 4;
|
||||
+ if (sptr >= end) {
|
||||
+ *dptr++ = BF_itoa64[c1];
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ c2 = *sptr++;
|
||||
+ c1 |= c2 >> 4;
|
||||
+ *dptr++ = BF_itoa64[c1];
|
||||
+ c1 = (c2 & 0x0f) << 2;
|
||||
+ if (sptr >= end) {
|
||||
+ *dptr++ = BF_itoa64[c1];
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ c2 = *sptr++;
|
||||
+ c1 |= c2 >> 6;
|
||||
+ *dptr++ = BF_itoa64[c1];
|
||||
+ *dptr++ = BF_itoa64[c2 & 0x3f];
|
||||
+ } while (sptr < end);
|
||||
+}
|
||||
+
|
||||
+char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
|
||||
+ const char *input, int size, char *output, int output_size)
|
||||
+{
|
||||
+ if (size < 16 || output_size < 7 + 22 + 1 ||
|
||||
+ (count && (count < 4 || count > 31)) ||
|
||||
+ prefix[0] != '$' || prefix[1] != '2' ||
|
||||
+ (prefix[2] != 'a' && prefix[2] != 'b' && prefix[2] != 'y')) {
|
||||
+ if (output_size > 0) output[0] = '\0';
|
||||
+ __set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (!count) count = 5;
|
||||
+
|
||||
+ output[0] = '$';
|
||||
+ output[1] = '2';
|
||||
+ output[2] = prefix[2];
|
||||
+ output[3] = '$';
|
||||
+ output[4] = '0' + count / 10;
|
||||
+ output[5] = '0' + count % 10;
|
||||
+ output[6] = '$';
|
||||
+
|
||||
+ BF_encode(&output[7], (const BF_word *)input, 16);
|
||||
+ output[7 + 22] = '\0';
|
||||
+
|
||||
+ return output;
|
||||
+}
|
||||
Index: crypt_blowfish-1.3/crypt_gensalt.h
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/crypt_gensalt.h
|
||||
+++ crypt_blowfish-1.3/crypt_gensalt.h
|
||||
@@ -28,5 +28,8 @@ extern char *_crypt_gensalt_md5_rn(const
|
||||
const char *input, int size, char *output, int output_size);
|
||||
extern char *_crypt_gensalt_sha2_rn(const char *prefix, unsigned long count,
|
||||
const char *input, int size, char *output, int output_size);
|
||||
+extern char *_crypt_gensalt_blowfish_rn(const char *prefix,
|
||||
+ unsigned long count,
|
||||
+ const char *input, int size, char *output, int output_size);
|
||||
|
||||
#endif
|
||||
Index: crypt_blowfish-1.3/wrapper-gensalt.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ crypt_blowfish-1.3/wrapper-gensalt.c
|
||||
@@ -0,0 +1,114 @@
|
||||
+/*
|
||||
+ * Written by Solar Designer <solar at openwall.com> in 2000-2011.
|
||||
+ * No copyright is claimed, and the software is hereby placed in the public
|
||||
+ * domain. In case this attempt to disclaim copyright and place the software
|
||||
+ * in the public domain is deemed null and void, then the software is
|
||||
+ * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the
|
||||
+ * general public under the following terms:
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted.
|
||||
+ *
|
||||
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
|
||||
+ *
|
||||
+ * See crypt_blowfish.c for more information.
|
||||
+ */
|
||||
+
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#ifndef __set_errno
|
||||
+#define __set_errno(val) errno = (val)
|
||||
+#endif
|
||||
+
|
||||
+#define CRYPT_GENSALT_OUTPUT_SIZE (7 + 22 + 1)
|
||||
+
|
||||
+#if defined(__GLIBC__) && defined(_LIBC)
|
||||
+#define __SKIP_GNU
|
||||
+#endif
|
||||
+#include "ow-crypt.h"
|
||||
+
|
||||
+#include "crypt_gensalt.h"
|
||||
+
|
||||
+#if !(defined(__GLIBC__) && defined(_LIBC))
|
||||
+#define __crypt_gensalt_rn crypt_gensalt_rn
|
||||
+#define __crypt_gensalt_ra crypt_gensalt_ra
|
||||
+#define __crypt_gensalt crypt_gensalt
|
||||
+#endif
|
||||
+
|
||||
+char *__crypt_gensalt_rn(const char *prefix, unsigned long count,
|
||||
+ const char *input, int size, char *output, int output_size)
|
||||
+{
|
||||
+ char *(*use)(const char *_prefix, unsigned long _count,
|
||||
+ const char *_input, int _size,
|
||||
+ char *_output, int _output_size);
|
||||
+
|
||||
+ /* This may be supported on some platforms in the future */
|
||||
+ if (!input) {
|
||||
+ __set_errno(EINVAL);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (!strncmp(prefix, "$5$", 3) || !strncmp(prefix, "$6$", 3))
|
||||
+ use = _crypt_gensalt_sha2_rn;
|
||||
+ else
|
||||
+ if (!strncmp(prefix, "$2a$", 4) || !strncmp(prefix, "$2b$", 4) ||
|
||||
+ !strncmp(prefix, "$2y$", 4))
|
||||
+ use = _crypt_gensalt_blowfish_rn;
|
||||
+ else
|
||||
+ if (!strncmp(prefix, "$1$", 3))
|
||||
+ use = _crypt_gensalt_md5_rn;
|
||||
+ else
|
||||
+ if (prefix[0] == '_')
|
||||
+ use = _crypt_gensalt_extended_rn;
|
||||
+ else
|
||||
+ if (!prefix[0] ||
|
||||
+ (prefix[0] && prefix[1] &&
|
||||
+ memchr(_crypt_itoa64, prefix[0], 64) &&
|
||||
+ memchr(_crypt_itoa64, prefix[1], 64)))
|
||||
+ use = _crypt_gensalt_traditional_rn;
|
||||
+ else {
|
||||
+ __set_errno(EINVAL);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return use(prefix, count, input, size, output, output_size);
|
||||
+}
|
||||
+
|
||||
+char *__crypt_gensalt_ra(const char *prefix, unsigned long count,
|
||||
+ const char *input, int size)
|
||||
+{
|
||||
+ char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
||||
+ char *retval;
|
||||
+
|
||||
+ retval = __crypt_gensalt_rn(prefix, count,
|
||||
+ input, size, output, sizeof(output));
|
||||
+
|
||||
+ if (retval) {
|
||||
+ retval = strdup(retval);
|
||||
+#ifndef __GLIBC__
|
||||
+ /* strdup(3) on glibc sets errno, so we don't need to bother */
|
||||
+ if (!retval)
|
||||
+ __set_errno(ENOMEM);
|
||||
+#endif
|
||||
+ }
|
||||
+
|
||||
+ return retval;
|
||||
+}
|
||||
+
|
||||
+char *__crypt_gensalt(const char *prefix, unsigned long count,
|
||||
+ const char *input, int size)
|
||||
+{
|
||||
+ static char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
||||
+
|
||||
+ return __crypt_gensalt_rn(prefix, count,
|
||||
+ input, size, output, sizeof(output));
|
||||
+}
|
||||
+
|
||||
+#if defined(__GLIBC__) && defined(_LIBC)
|
||||
+weak_alias(__crypt_gensalt_rn, crypt_gensalt_rn)
|
||||
+weak_alias(__crypt_gensalt_ra, crypt_gensalt_ra)
|
||||
+weak_alias(__crypt_gensalt, crypt_gensalt)
|
||||
+#endif
|
||||
+
|
||||
Index: crypt_blowfish-1.3/wrapper.c
|
||||
===================================================================
|
||||
--- crypt_blowfish-1.3.orig/wrapper.c
|
||||
+++ crypt_blowfish-1.3/wrapper.c
|
||||
@@ -35,7 +35,6 @@
|
||||
#endif
|
||||
|
||||
#define CRYPT_OUTPUT_SIZE (7 + 22 + 31 + 1)
|
||||
-#define CRYPT_GENSALT_OUTPUT_SIZE (7 + 22 + 1)
|
||||
|
||||
#if defined(__GLIBC__) && defined(_LIBC)
|
||||
#define __SKIP_GNU
|
||||
@@ -43,7 +42,6 @@
|
||||
#include "ow-crypt.h"
|
||||
|
||||
#include "crypt_blowfish.h"
|
||||
-#include "crypt_gensalt.h"
|
||||
|
||||
#if defined(__GLIBC__) && defined(_LIBC)
|
||||
/* crypt.h from glibc-crypt-2.1 will define struct crypt_data for us */
|
||||
@@ -209,89 +207,11 @@ char *crypt(const char *key, const char
|
||||
crypt_rn(key, setting, output, sizeof(output)),
|
||||
setting, output, sizeof(output));
|
||||
}
|
||||
-
|
||||
-#define __crypt_gensalt_rn crypt_gensalt_rn
|
||||
-#define __crypt_gensalt_ra crypt_gensalt_ra
|
||||
-#define __crypt_gensalt crypt_gensalt
|
||||
-#endif
|
||||
-
|
||||
-char *__crypt_gensalt_rn(const char *prefix, unsigned long count,
|
||||
- const char *input, int size, char *output, int output_size)
|
||||
-{
|
||||
- char *(*use)(const char *_prefix, unsigned long _count,
|
||||
- const char *_input, int _size,
|
||||
- char *_output, int _output_size);
|
||||
-
|
||||
- /* This may be supported on some platforms in the future */
|
||||
- if (!input) {
|
||||
- __set_errno(EINVAL);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- if (!strncmp(prefix, "$5$", 3) || !strncmp(prefix, "$6$", 3))
|
||||
- use = _crypt_gensalt_sha2_rn;
|
||||
- else
|
||||
- if (!strncmp(prefix, "$2a$", 4) || !strncmp(prefix, "$2b$", 4) ||
|
||||
- !strncmp(prefix, "$2y$", 4))
|
||||
- use = _crypt_gensalt_blowfish_rn;
|
||||
- else
|
||||
- if (!strncmp(prefix, "$1$", 3))
|
||||
- use = _crypt_gensalt_md5_rn;
|
||||
- else
|
||||
- if (prefix[0] == '_')
|
||||
- use = _crypt_gensalt_extended_rn;
|
||||
- else
|
||||
- if (!prefix[0] ||
|
||||
- (prefix[0] && prefix[1] &&
|
||||
- memchr(_crypt_itoa64, prefix[0], 64) &&
|
||||
- memchr(_crypt_itoa64, prefix[1], 64)))
|
||||
- use = _crypt_gensalt_traditional_rn;
|
||||
- else {
|
||||
- __set_errno(EINVAL);
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
- return use(prefix, count, input, size, output, output_size);
|
||||
-}
|
||||
-
|
||||
-char *__crypt_gensalt_ra(const char *prefix, unsigned long count,
|
||||
- const char *input, int size)
|
||||
-{
|
||||
- char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
||||
- char *retval;
|
||||
-
|
||||
- retval = __crypt_gensalt_rn(prefix, count,
|
||||
- input, size, output, sizeof(output));
|
||||
-
|
||||
- if (retval) {
|
||||
- retval = strdup(retval);
|
||||
-#ifndef __GLIBC__
|
||||
- /* strdup(3) on glibc sets errno, so we don't need to bother */
|
||||
- if (!retval)
|
||||
- __set_errno(ENOMEM);
|
||||
#endif
|
||||
- }
|
||||
-
|
||||
- return retval;
|
||||
-}
|
||||
-
|
||||
-char *__crypt_gensalt(const char *prefix, unsigned long count,
|
||||
- const char *input, int size)
|
||||
-{
|
||||
- static char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
||||
-
|
||||
- return __crypt_gensalt_rn(prefix, count,
|
||||
- input, size, output, sizeof(output));
|
||||
-}
|
||||
|
||||
#if defined(__GLIBC__) && defined(_LIBC)
|
||||
-weak_alias(__crypt_rn, crypt_rn)
|
||||
-weak_alias(__crypt_ra, crypt_ra)
|
||||
weak_alias(__crypt_r, crypt_r)
|
||||
weak_alias(__crypt, crypt)
|
||||
-weak_alias(__crypt_gensalt_rn, crypt_gensalt_rn)
|
||||
-weak_alias(__crypt_gensalt_ra, crypt_gensalt_ra)
|
||||
-weak_alias(__crypt_gensalt, crypt_gensalt)
|
||||
weak_alias(crypt, fcrypt)
|
||||
#endif
|
||||
|
@ -3,7 +3,7 @@ Always do locking when accessing streams (bug 15142)
|
||||
During exit, skip files that are currently locked to avoid deadlock.
|
||||
|
||||
[BZ #15142]
|
||||
* include/bits/libio.h (_IO_ftrylockfile) [_IO_MTSAVE_IO]: Define.
|
||||
* libio/libio.h (_IO_ftrylockfile) [_IO_MTSAVE_IO]: Define.
|
||||
* libio/genops.c (_IO_flush_all_lockp): Make static. Rename
|
||||
argument to skip_locked, callers changed. Skip files that are
|
||||
locked if skip_locked.
|
||||
@ -11,10 +11,10 @@ During exit, skip files that are currently locked to avoid deadlock.
|
||||
files.
|
||||
* libio/libioP.h (_IO_flush_all_lockp): Don't declare.
|
||||
|
||||
Index: glibc-2.27/include/bits/libio.h
|
||||
Index: glibc-2.27/libio/libio.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/include/bits/libio.h
|
||||
+++ glibc-2.27/include/bits/libio.h
|
||||
--- glibc-2.27.orig/libio/libio.h
|
||||
+++ glibc-2.27/libio/libio.h
|
||||
@@ -33,11 +33,15 @@ libc_hidden_proto (_IO_vfscanf)
|
||||
if (((_fp)->_flags & _IO_USER_LOCK) == 0) _IO_lock_lock (*(_fp)->_lock)
|
||||
# define _IO_funlockfile(_fp) \
|
||||
@ -35,9 +35,9 @@ Index: glibc-2.27/libio/genops.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/libio/genops.c
|
||||
+++ glibc-2.27/libio/genops.c
|
||||
@@ -744,8 +744,8 @@ _IO_get_column (_IO_FILE *fp)
|
||||
#endif
|
||||
|
||||
@@ -744,8 +744,8 @@ _IO_adjust_column (unsigned start, const
|
||||
}
|
||||
libc_hidden_def (_IO_adjust_column)
|
||||
|
||||
-int
|
||||
-_IO_flush_all_lockp (int do_lock)
|
||||
@ -45,9 +45,9 @@ Index: glibc-2.27/libio/genops.c
|
||||
+_IO_flush_all_lockp (bool skip_locked)
|
||||
{
|
||||
int result = 0;
|
||||
struct _IO_FILE *fp;
|
||||
FILE *fp;
|
||||
@@ -758,7 +758,16 @@ _IO_flush_all_lockp (int do_lock)
|
||||
for (fp = (_IO_FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
|
||||
for (fp = (FILE *) _IO_list_all; fp != NULL; fp = fp->_chain)
|
||||
{
|
||||
run_fp = fp;
|
||||
- if (do_lock)
|
||||
@ -85,7 +85,7 @@ Index: glibc-2.27/libio/genops.c
|
||||
|
||||
@@ -852,22 +860,18 @@ _IO_unbuffer_all (void)
|
||||
|
||||
for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
|
||||
for (fp = (FILE *) _IO_list_all; fp; fp = fp->_chain)
|
||||
{
|
||||
+ run_fp = fp;
|
||||
+ /* Skip files that are currently locked. */
|
||||
@ -151,9 +151,9 @@ Index: glibc-2.27/libio/libioP.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/libio/libioP.h
|
||||
+++ glibc-2.27/libio/libioP.h
|
||||
@@ -486,7 +486,6 @@ extern int _IO_new_do_write (_IO_FILE *,
|
||||
extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t);
|
||||
extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t);
|
||||
@@ -486,7 +486,6 @@ extern int _IO_new_do_write (FILE *, con
|
||||
extern int _IO_old_do_write (FILE *, const char *, size_t);
|
||||
extern int _IO_wdo_write (FILE *, const wchar_t *, size_t);
|
||||
libc_hidden_proto (_IO_wdo_write)
|
||||
-extern int _IO_flush_all_lockp (int);
|
||||
extern int _IO_flush_all (void);
|
||||
|
@ -7,6 +7,7 @@ Fix fnmatch handling of collating elements (BZ #17396, BZ #16976)
|
||||
sequence instead of name. Correct alignment adjustment.
|
||||
* posix/fnmatch.c: Don't include "../locale/elem-hash.h".
|
||||
* posix/Makefile (tests): Add tst-fnmatch4 and tst-fnmatch5.
|
||||
(LOCALES): Add cs_CZ.ISO-8859-2.
|
||||
* posix/tst-fnmatch4.c: New file.
|
||||
* posix/tst-fnmatch5.c: New file.
|
||||
|
||||
@ -22,6 +23,16 @@ Index: glibc-2.27/posix/Makefile
|
||||
tst-posix_spawn-fd tst-posix_spawn-setsid \
|
||||
tst-posix_fadvise tst-posix_fadvise64 \
|
||||
tst-sysconf-empty-chroot tst-glob_symlinks tst-fexecve \
|
||||
@@ -165,7 +166,8 @@ $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
|
||||
endif
|
||||
|
||||
LOCALES := cs_CZ.UTF-8 da_DK.ISO-8859-1 de_DE.ISO-8859-1 de_DE.UTF-8 \
|
||||
- en_US.UTF-8 es_US.ISO-8859-1 es_US.UTF-8 ja_JP.EUC-JP tr_TR.UTF-8
|
||||
+ en_US.UTF-8 es_US.ISO-8859-1 es_US.UTF-8 ja_JP.EUC-JP tr_TR.UTF-8 \
|
||||
+ cs_CZ.ISO-8859-2
|
||||
include ../gen-locales.mk
|
||||
|
||||
$(objpfx)bug-regex1.out: $(gen-locales)
|
||||
Index: glibc-2.27/posix/fnmatch.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/posix/fnmatch.c
|
||||
@ -381,7 +392,7 @@ Index: glibc-2.27/posix/tst-fnmatch4.c
|
||||
+static int
|
||||
+do_test_locale (const char *locale)
|
||||
+{
|
||||
+ const char *pattern = "[[.ll.]]";
|
||||
+ const char *pattern = "[[.ch.]]";
|
||||
+
|
||||
+ if (setlocale (LC_ALL, locale) == NULL)
|
||||
+ {
|
||||
@ -389,7 +400,7 @@ Index: glibc-2.27/posix/tst-fnmatch4.c
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if (fnmatch (pattern, "ll", 0) != 0)
|
||||
+ if (fnmatch (pattern, "ch", 0) != 0)
|
||||
+ {
|
||||
+ printf ("%s didn't match in locale %s\n", pattern, locale);
|
||||
+ return 1;
|
||||
@ -401,8 +412,8 @@ Index: glibc-2.27/posix/tst-fnmatch4.c
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ return (do_test_locale ("es_US.ISO-8859-1")
|
||||
+ || do_test_locale ("es_US.UTF-8"));
|
||||
+ return (do_test_locale ("cs_CZ.ISO-8859-2")
|
||||
+ || do_test_locale ("cs_CZ.UTF-8"));
|
||||
+}
|
||||
+
|
||||
+#define TEST_FUNCTION do_test ()
|
||||
|
@ -1,98 +0,0 @@
|
||||
Index: glibc-2.27/crypt/Makefile
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/crypt/Makefile
|
||||
+++ glibc-2.27/crypt/Makefile
|
||||
@@ -23,14 +23,18 @@ subdir := crypt
|
||||
include ../Makeconfig
|
||||
|
||||
headers := crypt.h
|
||||
+headers += gnu-crypt.h ow-crypt.h
|
||||
|
||||
-extra-libs := libcrypt
|
||||
+extra-libs := libcrypt libowcrypt
|
||||
extra-libs-others := $(extra-libs)
|
||||
|
||||
libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
|
||||
crypt_util
|
||||
|
||||
-tests := cert md5c-test sha256c-test sha512c-test badsalttest
|
||||
+libcrypt-routines += crypt_blowfish x86 wrapper
|
||||
+libowcrypt-routines := crypt_gensalt wrapper-gensalt
|
||||
+
|
||||
+tests := cert md5c-test sha256c-test sha512c-test
|
||||
|
||||
ifeq ($(crypt-in-libc),yes)
|
||||
routines += $(libcrypt-routines)
|
||||
Index: glibc-2.27/crypt/Versions
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/crypt/Versions
|
||||
+++ glibc-2.27/crypt/Versions
|
||||
@@ -3,3 +3,8 @@ libcrypt {
|
||||
crypt; crypt_r; encrypt; encrypt_r; fcrypt; setkey; setkey_r;
|
||||
}
|
||||
}
|
||||
+libowcrypt {
|
||||
+ OW_CRYPT_1.0 {
|
||||
+ crypt_gensalt; crypt_gensalt_rn; crypt_gensalt_ra;
|
||||
+ }
|
||||
+}
|
||||
Index: glibc-2.27/crypt/crypt-entry.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/crypt/crypt-entry.c
|
||||
+++ glibc-2.27/crypt/crypt-entry.c
|
||||
@@ -71,7 +71,7 @@ extern struct crypt_data _ufc_foobar;
|
||||
*/
|
||||
|
||||
char *
|
||||
-__crypt_r (const char *key, const char *salt,
|
||||
+__des_crypt_r (const char *key, const char *salt,
|
||||
struct crypt_data * __restrict data)
|
||||
{
|
||||
ufc_long res[4];
|
||||
@@ -152,6 +152,7 @@ __crypt_r (const char *key, const char *
|
||||
|
||||
return data->crypt_3_buf;
|
||||
}
|
||||
+#if 0
|
||||
weak_alias (__crypt_r, crypt_r)
|
||||
|
||||
char *
|
||||
@@ -190,3 +191,4 @@ __fcrypt (const char *key, const char *s
|
||||
return crypt (key, salt);
|
||||
}
|
||||
#endif
|
||||
+#endif
|
||||
Index: glibc-2.27/crypt/crypt-private.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/crypt/crypt-private.h
|
||||
+++ glibc-2.27/crypt/crypt-private.h
|
||||
@@ -65,7 +65,7 @@ extern void __encrypt_r (char * __restri
|
||||
struct crypt_data * __restrict __data);
|
||||
|
||||
/* crypt-entry.c */
|
||||
-extern char *__crypt_r (const char *__key, const char *__salt,
|
||||
+extern char *__des_crypt_r (const char *__key, const char *__salt,
|
||||
struct crypt_data * __restrict __data);
|
||||
extern char *fcrypt (const char *key, const char *salt);
|
||||
|
||||
Index: glibc-2.27/shlib-versions
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/shlib-versions
|
||||
+++ glibc-2.27/shlib-versions
|
||||
@@ -59,6 +59,7 @@ libnsl=1
|
||||
|
||||
# This defines the shared library version numbers we will install.
|
||||
libcrypt=1
|
||||
+libowcrypt=1
|
||||
|
||||
# The gross patch for programs assuming broken locale implementations.
|
||||
libBrokenLocale=1
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/libowcrypt.abilist
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/libowcrypt.abilist
|
||||
@@ -0,0 +1,4 @@
|
||||
+OW_CRYPT_1.0 OW_CRYPT_1.0 A
|
||||
+OW_CRYPT_1.0 crypt_gensalt F
|
||||
+OW_CRYPT_1.0 crypt_gensalt_ra F
|
||||
+OW_CRYPT_1.0 crypt_gensalt_rn F
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5172de54318ec0b7f2735e5a91d908afe1c9ca291fec16b5374d9faadfc1fc72
|
||||
size 15395316
|
@ -1,16 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIcBAABAgAGBQJac3pRAAoJEBZ5K06iU0D42ScP/1a2BmqiRw3vt2vtjRpZAeE+
|
||||
UcJ44FFbgRfybe2e0hSI9/Yl3aMRp3ntdUyrZrUKdDiiaBvWt6Ye7UWDHe0iraxM
|
||||
1PvQsVu1HmfXGgsAyMlk9XtfqvDqBXcFWE99HbTbuybT+W+JXP+751ioN73MTgp5
|
||||
ZECrYy3o5FUPHHb2MBA1zqY4sryWR+27vY+CP2BMSvLNIUpYKVe2xOMvayi2Asxr
|
||||
rTB6dlpcxwZaoErkqeOl4vgNO744WFMRj0RaMVN6/HkGfvuf1gzqcLjlsJ5AFpA/
|
||||
GliE9rJn7ogpV0cXgagcjt/+CuL/htvFOw9qTzkDrT41t0n3DBQ0HXwh60oCTN8I
|
||||
3gbuudLN51+cDWk17TcNh6PDyuYFEiZbIAmU2aRha+lsGGnQaoI8fS/thHfzzGBd
|
||||
P5jSvpHPfL3lp8PBwjgiuXElEi/hJlGYfjDfJZ5ta4p08362LcfHe1xNCSP49x5a
|
||||
V/ZV+Ggpsf6MiRmwQBNykA55s3akYgIOtBwDs0polookDcKJ/BzczNnWYNqX0Szv
|
||||
k4pvIEWsMLMsX9j3qnKbmmtlrcFTIwaQzQ75e3D1OFL3JCup7byoDf1icfRKWr8D
|
||||
3Y0FWExqQ3NYpR7F7hPsbU55DGqpMlLnVMTZ0wlEn9s1TyO1vWiba1BuVMtCICDJ
|
||||
fyTjM1MZXfBiFDcP1D4P
|
||||
=SzqE
|
||||
-----END PGP SIGNATURE-----
|
3
glibc-2.28.tar.xz
Normal file
3
glibc-2.28.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b1900051afad76f7a4f73e71413df4826dce085ef8ddb785a945b66d7d513082
|
||||
size 16484344
|
16
glibc-2.28.tar.xz.sig
Normal file
16
glibc-2.28.tar.xz.sig
Normal file
@ -0,0 +1,16 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIcBAABAgAGBQJbYVUmAAoJEBZ5K06iU0D43VkP/19+lsSsDZ97QfojgE/lXgJU
|
||||
5CmHV4Agjhf1MaFSbmDOwFjlMeU7TXkygQ7z9+E8oikRi69bGhFZjeUenr2mcWWi
|
||||
FKaF4EVYIM+r4nXJJeZVBKgmFZdzjyqklH2P7/koKuqzMuC8zHX8fLYqDhwxpquO
|
||||
lHGTR7ai5wFgBSfx/CflpAJ6ZVg9FCMA/GA2W9gJU9C3iyCux5LSrF2Oq035bQ0z
|
||||
3WAHdjqTzLV8SI2B4XEadmjMseLk+AQwJ+xEa5eoZd5qF3TJVzOWRfSNEJC1jd9S
|
||||
PonzLStU7u/YcDs33jiW+h4heXA8qK5grF6HaBvh8DBkzzJrMLRKBiprgRdt/UBq
|
||||
jGSTVUlGDCs39QnnOedWOBxza/mmm24nE6cOE8eTq+OUvdwR9uY4ADrx3bCYNJ+N
|
||||
B15JAkdfJguAYtqEFbXJL7j4ws18sjfphWbdQYZCUxgSZ9BRjrmPM1MFHlv7BDkx
|
||||
u/gDEYyGZSVcYAAZ6WOdRD5mjTFpN9kx7qxMqCWL9O1L0UL6cIc2tN6ZI+zBI24m
|
||||
60Nkh1R5zIepmsTxurYGm9vB+YqoR74N4gUz2LHMNRhZBCjGd4DYkriNOHlqLs1q
|
||||
W72Bn1uDnWqyWaH59HjNyHEh38qiF+4yD8pJIV38+EUJiUROt1f26ZDgtcys1l+5
|
||||
7mN5kVcGKT//Sim81yI5
|
||||
=nbAu
|
||||
-----END PGP SIGNATURE-----
|
@ -1,3 +1,63 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 2 07:48:07 UTC 2018 - schwab@suse.de
|
||||
|
||||
- Update to glibc 2.28
|
||||
* The localization data for ISO 14651 is updated to match the 2016
|
||||
Edition 4 release of the standard, this matches data provided by
|
||||
Unicode 9.0.0
|
||||
* Unicode 11.0.0 Support: Character encoding, character type info, and
|
||||
transliteration tables are all updated to Unicode 11.0.0, using
|
||||
generator scripts contributed by Mike FABIAN (Red Hat)
|
||||
* <math.h> functions that round their results to a narrower type are added
|
||||
from TS 18661-1:2014 and TS 18661-3:2015
|
||||
* Two grammatical forms of month names are now supported
|
||||
* The renameat2 function has been added, a variant of the renameat function
|
||||
which has a flags argument
|
||||
* The statx function has been added, a variant of the fstatat64
|
||||
function with an additional flags argument
|
||||
* IDN domain names in getaddrinfo and getnameinfo now use the system libidn2
|
||||
library if installed
|
||||
* Parsing of dynamic string tokens in DT_RPATH, DT_RUNPATH, DT_NEEDED,
|
||||
DT_AUXILIARY, and DT_FILTER has been expanded to support the full
|
||||
range of ELF gABI expressions including such constructs as
|
||||
'$ORIGIN$ORIGIN' (if valid)
|
||||
* Support for ISO C threads (ISO/IEC 9899:2011) has been added.
|
||||
* The nonstandard header files <libio.h> and <_G_config.h> are no longer
|
||||
installed
|
||||
* The stdio functions 'getc' and 'putc' are no longer defined as macros
|
||||
* All stdio functions now treat end-of-file as a sticky condition
|
||||
* The macros 'major', 'minor', and 'makedev' are now only available from
|
||||
the header <sys/sysmacros.h>
|
||||
* The obsolete function ustat is no longer available to newly linked
|
||||
binaries; the headers <ustat.h> and <sys/ustat.h> have been removed
|
||||
* The obsolete function nfsservctl is no longer available to newly linked
|
||||
binaries
|
||||
* The obsolete function name llseek is no longer available to newly linked
|
||||
binaries
|
||||
* The AI_IDN_ALLOW_UNASSIGNED and NI_IDN_ALLOW_UNASSIGNED flags for the
|
||||
getaddrinfo and getnameinfo functions have been deprecated
|
||||
* The AI_IDN_USE_STD3_ASCII_RULES and NI_IDN_USE_STD3_ASCII_RULES flags for
|
||||
the getaddrinfo and getnameinfo functions have been deprecated
|
||||
* The fcntl function now have a Long File Support variant named fcntl64
|
||||
* CVE-2016-6261, CVE-2016-6263, CVE-2017-14062: Various vulnerabilities have
|
||||
been fixed by removing the glibc-internal IDNA implementation and using
|
||||
the system-provided libidn2 library instead
|
||||
- Split off all libcrypt related functions into package libxcrypt
|
||||
- fix-locking-in-_IO_cleanup.patch, fnmatch-collating-elements.patch:
|
||||
Rediff
|
||||
- aarch64-sys-ptrace-update.patch,
|
||||
crypt_blowfish-1.2-hack_around_arm.diff, crypt_blowfish-1.2-sha.diff,
|
||||
crypt_blowfish-const.patch, crypt_blowfish-gensalt.patch,
|
||||
glibc-2.14-crypt.diff, i386-memmove-sse2-unaligned.patch,
|
||||
i386-sigaction-sa-restorer.patch, mempcpy-avx512.patch,
|
||||
netgroup-cache-keys.patch, nss-database-multiple-dfn.patch,
|
||||
pkey-get-reserved-name.patch, powerpc-sys-ptrace-undefine-macros.patch,
|
||||
powerpc-sys-ptrace-update.patch, realpath-ssize-max-overflow.patch,
|
||||
res-send-enomem.patch, riscv-fmax-fmin-nan.patch,
|
||||
riscv-kernel-sigaction.patch, riscv-readelflib.patch,
|
||||
riscv-tls-init.patch: Removed
|
||||
- glibc_post_upgrade.c: Don't reload init (bsc#1103124)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 19 08:37:43 UTC 2018 - schwab@suse.de
|
||||
|
||||
|
137
glibc.spec
137
glibc.spec
@ -20,7 +20,6 @@
|
||||
# It will avoid building some parts of glibc
|
||||
%bcond_with fast_build
|
||||
|
||||
%define crypt_bf_version 1.3
|
||||
%define build_snapshot 0
|
||||
%bcond_with ringdisabled
|
||||
|
||||
@ -71,6 +70,7 @@ BuildRequires: xz
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: gdb
|
||||
BuildRequires: glibc-devel-static
|
||||
BuildRequires: libidn2-0
|
||||
BuildRequires: libstdc++-devel
|
||||
BuildRequires: python3-pexpect
|
||||
%endif
|
||||
@ -146,10 +146,10 @@ BuildArch: i686
|
||||
%define enablekernel 4.15
|
||||
%endif
|
||||
|
||||
Version: 2.27
|
||||
Version: 2.28
|
||||
Release: 0
|
||||
%if !%{build_snapshot}
|
||||
%define git_id 3260f6ce87b7
|
||||
%define git_id 3c03baca37fd
|
||||
%define libversion %version
|
||||
%else
|
||||
%define git_id %(echo %version | sed 's/.*\.g//')
|
||||
@ -173,10 +173,6 @@ Source10: baselibs.conf
|
||||
# For systemd
|
||||
Source20: nscd.conf
|
||||
Source21: nscd.service
|
||||
# crypt_blowfish
|
||||
Source50: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_version}.tar.gz
|
||||
# The sign key uses MD5 which is no longer accepted by gpg
|
||||
#Source51: http://www.openwall.com/crypt/crypt_blowfish-%{crypt_bf_version}.tar.gz.sign
|
||||
|
||||
%if %{build_main}
|
||||
# ngpt was used in 8.1 and SLES8
|
||||
@ -230,16 +226,6 @@ NoSource: 0
|
||||
# openSUSE specific patches - won't go upstream
|
||||
###
|
||||
### openSUSE extensions, configuration
|
||||
# PATCH-FEATURE-OPENSUSE -- add crypt_blowfish support - bnc#700876
|
||||
Patch1: glibc-2.14-crypt.diff
|
||||
# PATCH-FEATURE-OPENSUSE constify crypt_blowfish
|
||||
Patch2: crypt_blowfish-const.patch
|
||||
# PATCH-FEATURE-OPENSUSE -- add sha support to crypt_blowfish lnussel@suse.de
|
||||
Patch3: crypt_blowfish-1.2-sha.diff
|
||||
# PATCH-FEATURE-OPENSUSE Move crypt_gensalt_rn to separate library
|
||||
Patch4: crypt_blowfish-gensalt.patch
|
||||
# PATCH-FEATURE-OPENSUSE Avoid build failure on noexecstack marker on ARM dmueller@suse.de
|
||||
Patch5: crypt_blowfish-1.2-hack_around_arm.diff
|
||||
# PATCH-FIX-OPENSUSE Fix path for nscd databases
|
||||
Patch6: glibc-2.3.3-nscd-db-path.diff
|
||||
# PATCH-FIX-OPENSUSE Fix path for nss_db (bnc#753657) - aj@suse.de
|
||||
@ -280,36 +266,6 @@ Patch306: glibc-fix-double-loopback.diff
|
||||
###
|
||||
# Patches from upstream
|
||||
###
|
||||
# PATCH-FIX-UPSTREAM Fix parsing flags in ELF64 files (BZ #22827)
|
||||
Patch1000: riscv-readelflib.patch
|
||||
# PATCH-FIX-UPSTREAM Fix multiple definitions of __nss_*_database (BZ #22918)
|
||||
Patch1001: nss-database-multiple-dfn.patch
|
||||
# PATCH-FIX-UPSTREAM Linux: use reserved name __key in pkey_get (BZ #22797)
|
||||
Patch1002: pkey-get-reserved-name.patch
|
||||
# PATCH-FIX-UPSTREAM linux/aarch64: sync sys/ptrace.h with Linux 4.15 (BZ #22433)
|
||||
Patch1003: aarch64-sys-ptrace-update.patch
|
||||
# PATCH-FIX-UPSTREAM powerpc: Undefine Linux ptrace macros that conflict with __ptrace_request
|
||||
Patch1004: powerpc-sys-ptrace-undefine-macros.patch
|
||||
# PATCH-FIX-UPSTREAM linux/powerpc: sync sys/ptrace.h with Linux 4.15 (BZ #22433, BZ #22807)
|
||||
Patch1005: powerpc-sys-ptrace-update.patch
|
||||
# PATCH-FIX-UPSTREAM Fix netgroup cache keys (BZ #22342)
|
||||
Patch1006: netgroup-cache-keys.patch
|
||||
# PATCH-FIX-UPSTREAM i386: Fix i386 sigaction sa_restorer initialization (BZ #21269)
|
||||
Patch1007: i386-sigaction-sa-restorer.patch
|
||||
# PATCH-FIX-UPSTREAM RISC-V: Do not initialize $gp in TLS macros
|
||||
Patch1008: riscv-tls-init.patch
|
||||
# PATCH-FIX-UPSTREAM RISC-V: fmax/fmin: Handle signalling NaNs correctly (BZ #22884)
|
||||
Patch1009: riscv-fmax-fmin-nan.patch
|
||||
# PATCH-FIX-UPSTREAM Fix crash in resolver on memory allocation failure (BZ #23005)
|
||||
Patch1010: res-send-enomem.patch
|
||||
# PATCH-FIX-UPSTREAM memmove-sse2-unaligned on 32bit x86 produces garbage when crossing 2GB threshold (CVE-2017-18269, BZ #22644)
|
||||
Patch1011: i386-memmove-sse2-unaligned.patch
|
||||
# PATCH-FIX-UPSTREAM __mempcpy_avx512_no_vzeroupper mishandles large copies (CVE-2018-11237, BZ #23196)
|
||||
Patch1012: mempcpy-avx512.patch
|
||||
# PATCH-FIX-UPSTREAM realpath-ssize-max-overflow.patch: Fix overflow in path length computation (CVE-2018-11236, BZ #22786)
|
||||
Patch1013: realpath-ssize-max-overflow.patch
|
||||
# PATCH-FIX-UPSTREAM RISC-V: fix struct kernel_sigaction to match the kernel version (BZ #23069)
|
||||
Patch1014: riscv-kernel-sigaction.patch
|
||||
|
||||
###
|
||||
# Patches awaiting upstream approval
|
||||
@ -453,6 +409,7 @@ Obsoletes: glibc-devel-64bit
|
||||
Obsoletes: glibc-devel-32bit
|
||||
%endif
|
||||
Requires: glibc = %{version}
|
||||
Requires: libxcrypt-devel
|
||||
Requires: linux-kernel-headers
|
||||
|
||||
%description devel
|
||||
@ -464,6 +421,7 @@ Summary: C library static libraries for -static linking
|
||||
License: BSD-3-Clause AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name}-devel = %{version}
|
||||
Requires: libxcrypt-devel-static
|
||||
# Provide Fedora name for package to make packaging easier
|
||||
Provides: %{name}-static = %{version}
|
||||
|
||||
@ -489,18 +447,6 @@ makedb: A program to create a database for nss
|
||||
|
||||
%prep
|
||||
%setup -n glibc-%{version} -q -a 4
|
||||
# Owl crypt_blowfish
|
||||
tar -xzf %SOURCE50
|
||||
pushd crypt_blowfish-%{crypt_bf_version}
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5
|
||||
popd
|
||||
mv crypt/{crypt.h,gnu-crypt.h}
|
||||
mv crypt_blowfish-%crypt_bf_version/*.[chS] crypt/
|
||||
#
|
||||
%patch1 -p1
|
||||
%patch6 -p1
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
@ -519,22 +465,6 @@ mv crypt_blowfish-%crypt_bf_version/*.[chS] crypt/
|
||||
%patch304 -p1
|
||||
%patch306 -p1
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1001 -p1
|
||||
%patch1002 -p1
|
||||
%patch1003 -p1
|
||||
%patch1004 -p1
|
||||
%patch1005 -p1
|
||||
%patch1006 -p1
|
||||
%patch1007 -p1
|
||||
%patch1008 -p1
|
||||
%patch1009 -p1
|
||||
%patch1010 -p1
|
||||
%patch1011 -p1
|
||||
%patch1012 -p1
|
||||
%patch1013 -p1
|
||||
%patch1014 -p1
|
||||
|
||||
%patch2000 -p1
|
||||
%patch2004 -p1
|
||||
%patch2005 -p1
|
||||
@ -601,7 +531,6 @@ done
|
||||
BuildFlags=$(echo $BuildFlags | sed -e 's#-fstack-protector[^ ]*##' -e 's#-ffortify=[0-9]*##')
|
||||
BuildCC="%__cc"
|
||||
BuildCCplus="%__cxx"
|
||||
add_ons=libidn
|
||||
#
|
||||
#now overwrite for some architectures
|
||||
#
|
||||
@ -670,7 +599,6 @@ configure_and_build_glibc() {
|
||||
CC="$BuildCC" CXX="$BuildCCplus" \
|
||||
--prefix=%{_prefix} \
|
||||
--libexecdir=%{_libexecdir} --infodir=%{_infodir} \
|
||||
--enable-add-ons=$add_ons \
|
||||
$profile \
|
||||
"$@" \
|
||||
--build=%{target} --host=%{target} \
|
||||
@ -692,8 +620,8 @@ configure_and_build_glibc() {
|
||||
--with-bugurl=http://bugs.opensuse.org \
|
||||
--enable-bind-now \
|
||||
--enable-systemtap \
|
||||
--disable-timezone-tools
|
||||
# Should we enable --enable-nss-crypt to build use freebl3 hash functions?
|
||||
--disable-timezone-tools \
|
||||
--disable-crypt
|
||||
# explicitly set CFLAGS to use the full CFLAGS (not the reduced one for configure)
|
||||
make %{?_smp_mflags} CFLAGS="$cflags" BUILD_CFLAGS="$cflags"
|
||||
cd ..
|
||||
@ -752,29 +680,35 @@ make -C cc-base html
|
||||
#
|
||||
# Build glibc_post_upgrade binary
|
||||
#
|
||||
$BuildCC -static %{optflags} -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \
|
||||
-Lcc-base -Bcc-base/csu \
|
||||
'-DREMOVE_TLS_DIRS' '-DREMOVE_PPC_OPTIMIZE_POWER5' \
|
||||
mkdir glibc-post-upgrade
|
||||
cat > glibc-post-upgrade/Makefile <<\EOF
|
||||
subdir := glibc-post-upgrade
|
||||
include ../Makeconfig
|
||||
vpath %.c $(dir %{SOURCE8})
|
||||
others = glibc_post_upgrade
|
||||
others-static = glibc_post_upgrade
|
||||
libof-glibc_post_upgrade = glibc_post_upgrade
|
||||
$(objpfx)glibc_post_upgrade: $(common-objpfx)elf/static-stubs.o
|
||||
CFLAGS-glibc_post_upgrade.o = \
|
||||
-Os -Wno-write-strings -DREMOVE_TLS_DIRS -DREMOVE_PPC_OPTIMIZE_POWER5 \
|
||||
%ifarch ppc ppc64
|
||||
%if !%{powerpc_optimize_cpu_power4}
|
||||
'-DREMOVE_PPC_OPTIMIZE_POWER4' \
|
||||
-DREMOVE_PPC_OPTIMIZE_POWER4 \
|
||||
%endif
|
||||
%if !%{powerpc_optimize_cpu_power6}
|
||||
'-DREMOVE_PPC_OPTIMIZE_POWER6' \
|
||||
-DREMOVE_PPC_OPTIMIZE_POWER6 \
|
||||
%endif
|
||||
%if !%{powerpc_optimize_cpu_power7}
|
||||
'-DREMOVE_PPC_OPTIMIZE_POWER7' \
|
||||
-DREMOVE_PPC_OPTIMIZE_POWER7 \
|
||||
%endif
|
||||
%if !%{powerpc_optimize_cpu_cell}
|
||||
'-DREMOVE_PPC_OPTIMIZE_CELL' \
|
||||
-DREMOVE_PPC_OPTIMIZE_CELL \
|
||||
%endif
|
||||
%endif
|
||||
'-DLIBDIR="/%{_lib}"' '-DGCONV_MODULES_DIR="%{_libdir}/gconv"'
|
||||
|
||||
# crypt_blowfish man pages
|
||||
pushd crypt_blowfish-%{crypt_bf_version}
|
||||
make man
|
||||
popd
|
||||
-DLIBDIR='"/%{_lib}"' -DGCONV_MODULES_DIR='"%{_libdir}/gconv"'
|
||||
include ../Rules
|
||||
EOF
|
||||
make -C cc-base subdirs=glibc-post-upgrade glibc-post-upgrade/others
|
||||
|
||||
%check
|
||||
%if %{build_testsuite}
|
||||
@ -913,7 +847,7 @@ cc-base/elf/ldconfig -vn $destdir
|
||||
|
||||
# Miscelanna:
|
||||
|
||||
install -m 0700 glibc_post_upgrade %{buildroot}%{_sbindir}
|
||||
install -m 0700 cc-base/glibc-post-upgrade/glibc_post_upgrade %{buildroot}%{_sbindir}
|
||||
|
||||
install -m 644 %{SOURCE7} %{buildroot}/etc
|
||||
install -m 644 %{SOURCE5} %{buildroot}/etc
|
||||
@ -933,12 +867,6 @@ cp -p cc-base/manual/libc/*.html %{buildroot}%{_datadir}/doc/glibc
|
||||
|
||||
cd manpages; make install_root=%{buildroot} install; cd ..
|
||||
|
||||
# crypt_blowfish man pages
|
||||
pushd crypt_blowfish-%{crypt_bf_version}
|
||||
install -m755 -d %{buildroot}%{_mandir}/man3
|
||||
install -m644 *.3 %{buildroot}%{_mandir}/man3
|
||||
popd
|
||||
|
||||
# nscd tools:
|
||||
|
||||
%ifnarch i686
|
||||
@ -1170,12 +1098,6 @@ exit 0
|
||||
/%{_lib}/libanl.so.1
|
||||
/%{_lib}/libc-%{libversion}.so
|
||||
/%{_lib}/libc.so.6*
|
||||
/%{_lib}/libcidn-%{libversion}.so
|
||||
/%{_lib}/libcidn.so.1
|
||||
/%{_lib}/libcrypt-%{libversion}.so
|
||||
/%{_lib}/libcrypt.so.1
|
||||
/%{_lib}/libowcrypt-%{libversion}.so
|
||||
/%{_lib}/libowcrypt.so.1
|
||||
/%{_lib}/libdl-%{libversion}.so
|
||||
/%{_lib}/libdl.so.2*
|
||||
/%{_lib}/libm-%{libversion}.so
|
||||
@ -1281,15 +1203,12 @@ exit 0
|
||||
%ifarch x86_64
|
||||
%{_libdir}/libmvec_nonshared.a
|
||||
%endif
|
||||
%{_libdir}/libpthread_nonshared.a
|
||||
|
||||
%files devel-static
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libBrokenLocale.a
|
||||
%{_libdir}/libanl.a
|
||||
%{_libdir}/libc.a
|
||||
%{_libdir}/libcrypt.a
|
||||
%{_libdir}/libowcrypt.a
|
||||
%{_libdir}/libdl.a
|
||||
%{_libdir}/libm.a
|
||||
%ifarch x86_64
|
||||
@ -1347,8 +1266,6 @@ exit 0
|
||||
%ifarch x86_64
|
||||
%{_libdir}/libmvec_p.a
|
||||
%endif
|
||||
%{_libdir}/libcrypt_p.a
|
||||
%{_libdir}/libowcrypt_p.a
|
||||
%{_libdir}/libpthread_p.a
|
||||
%{_libdir}/libresolv_p.a
|
||||
%{_libdir}/librt_p.a
|
||||
|
@ -1,6 +1,8 @@
|
||||
/* skeleton based on version from Fedora Core 3 */
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
@ -26,14 +28,10 @@ __attribute__((noinline)) void vexec (int failcode, char *const path[]);
|
||||
__attribute__((noinline)) void says (const char *str);
|
||||
__attribute__((noinline)) void sayn (long num);
|
||||
__attribute__((noinline)) void message (char *const path[]);
|
||||
__attribute__((noinline)) int check_elf (const char *name);
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
char initpath[256];
|
||||
struct stat root, init_root;
|
||||
|
||||
/* First, get rid of platform-optimized libraries. We remove any we have
|
||||
ever built, since otherwise we might end up using some old leftover
|
||||
libraries when new ones aren't installed in their place anymore. */
|
||||
@ -128,33 +126,6 @@ main (void)
|
||||
"--nostdlib", GCONV_MODULES_DIR);
|
||||
}
|
||||
|
||||
/* Check if telinit is available and the init fifo as well. */
|
||||
if (access ("/sbin/telinit", X_OK) || access ("/dev/initctl", F_OK))
|
||||
_exit (0);
|
||||
/* Check if we are not inside of some chroot, because we'd just
|
||||
timeout and leave /etc/initrunlvl. */
|
||||
if (readlink ("/proc/1/exe", initpath, 256) <= 0 ||
|
||||
readlink ("/proc/1/root", initpath, 256) <= 0 ||
|
||||
access ("/.buildenv", F_OK) == 0 || /* XEN build */
|
||||
stat ("/proc/1/root", &init_root) < 0 ||
|
||||
stat ("/", &root) < 0 ||
|
||||
init_root.st_dev != root.st_dev || init_root.st_ino != root.st_ino)
|
||||
_exit (0);
|
||||
|
||||
if (check_elf ("/proc/1/exe"))
|
||||
verbose_exec (116, "/sbin/telinit", "/sbin/telinit", "u");
|
||||
|
||||
#if 0
|
||||
/* Check if we can safely condrestart sshd. */
|
||||
if (access ("/sbin/service", X_OK) == 0
|
||||
&& access ("/usr/sbin/sshd", X_OK) == 0
|
||||
&& access ("/bin/bash", X_OK) == 0)
|
||||
{
|
||||
if (check_elf ("/usr/sbin/sshd"))
|
||||
verbose_exec (121, "/sbin/service", "/sbin/service", "sshd", "condrestart");
|
||||
}
|
||||
#endif
|
||||
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
@ -231,106 +202,3 @@ message (char *const path[])
|
||||
says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
|
||||
says (path[0]);
|
||||
}
|
||||
|
||||
int
|
||||
check_elf (const char *name)
|
||||
{
|
||||
/* Play safe, if we can't open or read, assume it might be
|
||||
ELF for the current arch. */
|
||||
int ret = 1;
|
||||
int fd = open (name, O_RDONLY);
|
||||
if (fd >= 0)
|
||||
{
|
||||
Elf32_Ehdr ehdr;
|
||||
if (read (fd, &ehdr, offsetof (Elf32_Ehdr, e_version))
|
||||
== offsetof (Elf32_Ehdr, e_version))
|
||||
{
|
||||
ret = 0;
|
||||
if (ehdr.e_ident[EI_CLASS]
|
||||
== (sizeof (long) == 8 ? ELFCLASS64 : ELFCLASS32))
|
||||
{
|
||||
#if defined __i386__
|
||||
ret = ehdr.e_machine == EM_386;
|
||||
#elif defined __x86_64__
|
||||
ret = ehdr.e_machine == EM_X86_64;
|
||||
#elif defined __ia64__
|
||||
ret = ehdr.e_machine == EM_IA_64;
|
||||
#elif defined __powerpc64__
|
||||
ret = ehdr.e_machine == EM_PPC64;
|
||||
#elif defined __powerpc__
|
||||
ret = ehdr.e_machine == EM_PPC;
|
||||
#elif defined __s390__ || defined __s390x__
|
||||
ret = ehdr.e_machine == EM_S390;
|
||||
#elif defined __x86_64__
|
||||
ret = ehdr.e_machine == EM_X86_64;
|
||||
#elif defined __sparc__
|
||||
if (sizeof (long) == 8)
|
||||
ret = ehdr.e_machine == EM_SPARCV9;
|
||||
else
|
||||
ret = (ehdr.e_machine == EM_SPARC
|
||||
|| ehdr.e_machine == EM_SPARC32PLUS);
|
||||
#else
|
||||
ret = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
close (fd);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef SMALL_BINARY
|
||||
|
||||
int __libc_multiple_threads __attribute__((nocommon));
|
||||
int __libc_enable_asynccancel (void) { return 0; }
|
||||
void __libc_disable_asynccancel (int x) { }
|
||||
void __libc_csu_init (void) { }
|
||||
void __libc_csu_fini (void) { }
|
||||
pid_t __fork (void) { return -1; }
|
||||
char thr_buf[65536];
|
||||
|
||||
#ifndef __powerpc__
|
||||
int
|
||||
__libc_start_main (int (*main) (void), int argc, char **argv,
|
||||
void (*init) (void), void (*fini) (void),
|
||||
void (*rtld_fini) (void), void * stack_end)
|
||||
#else
|
||||
struct startup_info
|
||||
{
|
||||
void *sda_base;
|
||||
int (*main) (int, char **, char **, void *);
|
||||
int (*init) (int, char **, char **, void *);
|
||||
void (*fini) (void);
|
||||
};
|
||||
|
||||
int
|
||||
__libc_start_main (int argc, char **ubp_av, char **ubp_ev,
|
||||
void *auxvec, void (*rtld_fini) (void),
|
||||
struct startup_info *stinfo,
|
||||
char **stack_on_entry)
|
||||
#endif
|
||||
{
|
||||
#if defined __ia64__ || defined __powerpc64__
|
||||
register void *r13 __asm ("r13") = thr_buf + 32768;
|
||||
__asm ("" : : "r" (r13));
|
||||
#elif defined __sparc__
|
||||
register void *g6 __asm ("g6") = thr_buf + 32768;
|
||||
# ifdef __arch64__
|
||||
__thread_self = thr_buf + 32768;
|
||||
# else
|
||||
register void *__thread_self __asm ("g7") = thr_buf + 32768;
|
||||
# endif
|
||||
__asm ("" : : "r" (g6), "r" (__thread_self));
|
||||
#elif defined __s390__ && !defined __s390x__
|
||||
__asm ("sar %%a0,%0" : : "d" (thr_buf + 32768));
|
||||
#elif defined __s390x__
|
||||
__asm ("sar %%a1,%0; srlg 0,%0,32; sar %%a0,0" : : "d" (thr_buf + 32768) : "0");
|
||||
#elif defined __powerpc__ && !defined __powerpc64__
|
||||
register void *r2 __asm ("r2") = thr_buf + 32768;
|
||||
__asm ("" : : "r" (r2));
|
||||
#endif
|
||||
main();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,149 +0,0 @@
|
||||
2018-03-23 Andrew Senkevich <andrew.senkevich@intel.com>
|
||||
Max Horn <max@quendi.de>
|
||||
|
||||
[BZ #22644]
|
||||
* sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S: Fixed
|
||||
branch conditions.
|
||||
* string/test-memmove.c (do_test2): New testcase.
|
||||
|
||||
Index: glibc-2.27/string/test-memmove.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/string/test-memmove.c
|
||||
+++ glibc-2.27/string/test-memmove.c
|
||||
@@ -24,6 +24,7 @@
|
||||
# define TEST_NAME "memmove"
|
||||
#endif
|
||||
#include "test-string.h"
|
||||
+#include <support/test-driver.h>
|
||||
|
||||
char *simple_memmove (char *, const char *, size_t);
|
||||
|
||||
@@ -245,6 +246,60 @@ do_random_tests (void)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+do_test2 (void)
|
||||
+{
|
||||
+ size_t size = 0x20000000;
|
||||
+ uint32_t * large_buf;
|
||||
+
|
||||
+ large_buf = mmap ((void*) 0x70000000, size, PROT_READ | PROT_WRITE,
|
||||
+ MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
+
|
||||
+ if (large_buf == MAP_FAILED)
|
||||
+ error (EXIT_UNSUPPORTED, errno, "Large mmap failed");
|
||||
+
|
||||
+ if ((uintptr_t) large_buf > 0x80000000 - 128
|
||||
+ || 0x80000000 - (uintptr_t) large_buf > 0x20000000)
|
||||
+ {
|
||||
+ error (0, 0, "Large mmap allocated improperly");
|
||||
+ ret = EXIT_UNSUPPORTED;
|
||||
+ munmap ((void *) large_buf, size);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ size_t bytes_move = 0x80000000 - (uintptr_t) large_buf;
|
||||
+ size_t arr_size = bytes_move / sizeof (uint32_t);
|
||||
+ size_t i;
|
||||
+
|
||||
+ FOR_EACH_IMPL (impl, 0)
|
||||
+ {
|
||||
+ for (i = 0; i < arr_size; i++)
|
||||
+ large_buf[i] = (uint32_t) i;
|
||||
+
|
||||
+ uint32_t * dst = &large_buf[33];
|
||||
+
|
||||
+#ifdef TEST_BCOPY
|
||||
+ CALL (impl, (char *) large_buf, (char *) dst, bytes_move);
|
||||
+#else
|
||||
+ CALL (impl, (char *) dst, (char *) large_buf, bytes_move);
|
||||
+#endif
|
||||
+
|
||||
+ for (i = 0; i < arr_size; i++)
|
||||
+ {
|
||||
+ if (dst[i] != (uint32_t) i)
|
||||
+ {
|
||||
+ error (0, 0,
|
||||
+ "Wrong result in function %s dst \"%p\" src \"%p\" offset \"%zd\"",
|
||||
+ impl->name, dst, large_buf, i);
|
||||
+ ret = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ munmap ((void *) large_buf, size);
|
||||
+}
|
||||
+
|
||||
int
|
||||
test_main (void)
|
||||
{
|
||||
@@ -284,6 +339,9 @@ test_main (void)
|
||||
}
|
||||
|
||||
do_random_tests ();
|
||||
+
|
||||
+ do_test2 ();
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
Index: glibc-2.27/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
|
||||
+++ glibc-2.27/sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
|
||||
@@ -72,7 +72,7 @@ ENTRY (MEMCPY)
|
||||
cmp %edx, %eax
|
||||
|
||||
# ifdef USE_AS_MEMMOVE
|
||||
- jg L(check_forward)
|
||||
+ ja L(check_forward)
|
||||
|
||||
L(mm_len_0_or_more_backward):
|
||||
/* Now do checks for lengths. We do [0..16], [16..32], [32..64], [64..128]
|
||||
@@ -81,7 +81,7 @@ L(mm_len_0_or_more_backward):
|
||||
jbe L(mm_len_0_16_bytes_backward)
|
||||
|
||||
cmpl $32, %ecx
|
||||
- jg L(mm_len_32_or_more_backward)
|
||||
+ ja L(mm_len_32_or_more_backward)
|
||||
|
||||
/* Copy [0..32] and return. */
|
||||
movdqu (%eax), %xmm0
|
||||
@@ -92,7 +92,7 @@ L(mm_len_0_or_more_backward):
|
||||
|
||||
L(mm_len_32_or_more_backward):
|
||||
cmpl $64, %ecx
|
||||
- jg L(mm_len_64_or_more_backward)
|
||||
+ ja L(mm_len_64_or_more_backward)
|
||||
|
||||
/* Copy [0..64] and return. */
|
||||
movdqu (%eax), %xmm0
|
||||
@@ -107,7 +107,7 @@ L(mm_len_32_or_more_backward):
|
||||
|
||||
L(mm_len_64_or_more_backward):
|
||||
cmpl $128, %ecx
|
||||
- jg L(mm_len_128_or_more_backward)
|
||||
+ ja L(mm_len_128_or_more_backward)
|
||||
|
||||
/* Copy [0..128] and return. */
|
||||
movdqu (%eax), %xmm0
|
||||
@@ -132,7 +132,7 @@ L(mm_len_128_or_more_backward):
|
||||
add %ecx, %eax
|
||||
cmp %edx, %eax
|
||||
movl SRC(%esp), %eax
|
||||
- jle L(forward)
|
||||
+ jbe L(forward)
|
||||
PUSH (%esi)
|
||||
PUSH (%edi)
|
||||
PUSH (%ebx)
|
||||
@@ -269,7 +269,7 @@ L(check_forward):
|
||||
add %edx, %ecx
|
||||
cmp %eax, %ecx
|
||||
movl LEN(%esp), %ecx
|
||||
- jle L(forward)
|
||||
+ jbe L(forward)
|
||||
|
||||
/* Now do checks for lengths. We do [0..16], [0..32], [0..64], [0..128]
|
||||
separately. */
|
@ -1,281 +0,0 @@
|
||||
2018-03-03 Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
||||
|
||||
[BZ #21269]
|
||||
* sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269.
|
||||
* sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear
|
||||
sa_restorer for vDSO case.
|
||||
* sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/i386/Makefile
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/i386/Makefile
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/i386/Makefile
|
||||
@@ -3,6 +3,9 @@ default-abi := 32
|
||||
|
||||
ifeq ($(subdir),misc)
|
||||
sysdep_routines += ioperm iopl vm86
|
||||
+
|
||||
+tests += tst-bz21269
|
||||
+$(objpfx)tst-bz21269: $(shared-thread-library)
|
||||
endif
|
||||
|
||||
ifeq ($(subdir),elf)
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/i386/sigaction.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/i386/sigaction.c
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/i386/sigaction.c
|
||||
@@ -42,7 +42,6 @@ extern void restore_rt (void) asm ("__re
|
||||
#endif
|
||||
extern void restore (void) asm ("__restore") attribute_hidden;
|
||||
|
||||
-
|
||||
/* If ACT is not NULL, change the action for SIG to *ACT.
|
||||
If OACT is not NULL, put the old action for SIG in *OACT. */
|
||||
int
|
||||
@@ -65,6 +64,8 @@ __libc_sigaction (int sig, const struct
|
||||
kact.sa_restorer = ((act->sa_flags & SA_SIGINFO)
|
||||
? &restore_rt : &restore);
|
||||
}
|
||||
+ else
|
||||
+ kact.sa_restorer = NULL;
|
||||
}
|
||||
|
||||
/* XXX The size argument hopefully will have to be changed to the
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/i386/tst-bz21269.c
|
||||
@@ -0,0 +1,233 @@
|
||||
+/* Test for i386 sigaction sa_restorer handling (BZ#21269)
|
||||
+ Copyright (C) 2017 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
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* This is based on Linux test tools/testing/selftests/x86/ldt_gdt.c,
|
||||
+ more specifically in do_multicpu_tests function. The main changes
|
||||
+ are:
|
||||
+
|
||||
+ - C11 atomics instead of plain access.
|
||||
+ - Remove x86_64 support which simplifies the syscall handling
|
||||
+ and fallbacks.
|
||||
+ - Replicate only the test required to trigger the issue for the
|
||||
+ BZ#21269. */
|
||||
+
|
||||
+#include <stdatomic.h>
|
||||
+
|
||||
+#include <asm/ldt.h>
|
||||
+#include <linux/futex.h>
|
||||
+
|
||||
+#include <setjmp.h>
|
||||
+#include <signal.h>
|
||||
+#include <errno.h>
|
||||
+#include <sys/syscall.h>
|
||||
+#include <sys/mman.h>
|
||||
+
|
||||
+#include <support/xunistd.h>
|
||||
+#include <support/check.h>
|
||||
+#include <support/xthread.h>
|
||||
+
|
||||
+static int
|
||||
+xset_thread_area (struct user_desc *u_info)
|
||||
+{
|
||||
+ long ret = syscall (SYS_set_thread_area, u_info);
|
||||
+ TEST_VERIFY_EXIT (ret == 0);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+xmodify_ldt (int func, const void *ptr, unsigned long bytecount)
|
||||
+{
|
||||
+ TEST_VERIFY_EXIT (syscall (SYS_modify_ldt, 1, ptr, bytecount) == 0);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+futex (int *uaddr, int futex_op, int val, void *timeout, int *uaddr2,
|
||||
+ int val3)
|
||||
+{
|
||||
+ return syscall (SYS_futex, uaddr, futex_op, val, timeout, uaddr2, val3);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+xsethandler (int sig, void (*handler)(int, siginfo_t *, void *), int flags)
|
||||
+{
|
||||
+ struct sigaction sa = { 0 };
|
||||
+ sa.sa_sigaction = handler;
|
||||
+ sa.sa_flags = SA_SIGINFO | flags;
|
||||
+ TEST_VERIFY_EXIT (sigemptyset (&sa.sa_mask) == 0);
|
||||
+ TEST_VERIFY_EXIT (sigaction (sig, &sa, 0) == 0);
|
||||
+}
|
||||
+
|
||||
+static jmp_buf jmpbuf;
|
||||
+
|
||||
+static void
|
||||
+sigsegv_handler (int sig, siginfo_t *info, void *ctx_void)
|
||||
+{
|
||||
+ siglongjmp (jmpbuf, 1);
|
||||
+}
|
||||
+
|
||||
+/* Points to an array of 1024 ints, each holding its own index. */
|
||||
+static const unsigned int *counter_page;
|
||||
+static struct user_desc *low_user_desc;
|
||||
+static struct user_desc *low_user_desc_clear; /* Used to delete GDT entry. */
|
||||
+static int gdt_entry_num;
|
||||
+
|
||||
+static void
|
||||
+setup_counter_page (void)
|
||||
+{
|
||||
+ long page_size = sysconf (_SC_PAGE_SIZE);
|
||||
+ TEST_VERIFY_EXIT (page_size > 0);
|
||||
+ unsigned int *page = xmmap (NULL, page_size, PROT_READ | PROT_WRITE,
|
||||
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
|
||||
+ for (int i = 0; i < (page_size / sizeof (unsigned int)); i++)
|
||||
+ page[i] = i;
|
||||
+ counter_page = page;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+setup_low_user_desc (void)
|
||||
+{
|
||||
+ low_user_desc = xmmap (NULL, 2 * sizeof (struct user_desc),
|
||||
+ PROT_READ | PROT_WRITE,
|
||||
+ MAP_ANONYMOUS | MAP_PRIVATE | MAP_32BIT, -1);
|
||||
+
|
||||
+ low_user_desc->entry_number = -1;
|
||||
+ low_user_desc->base_addr = (unsigned long) &counter_page[1];
|
||||
+ low_user_desc->limit = 0xffff;
|
||||
+ low_user_desc->seg_32bit = 1;
|
||||
+ low_user_desc->contents = 0;
|
||||
+ low_user_desc->read_exec_only = 0;
|
||||
+ low_user_desc->limit_in_pages = 1;
|
||||
+ low_user_desc->seg_not_present = 0;
|
||||
+ low_user_desc->useable = 0;
|
||||
+
|
||||
+ xset_thread_area (low_user_desc);
|
||||
+
|
||||
+ low_user_desc_clear = low_user_desc + 1;
|
||||
+ low_user_desc_clear->entry_number = gdt_entry_num;
|
||||
+ low_user_desc_clear->read_exec_only = 1;
|
||||
+ low_user_desc_clear->seg_not_present = 1;
|
||||
+}
|
||||
+
|
||||
+/* Possible values of futex:
|
||||
+ 0: thread is idle.
|
||||
+ 1: thread armed.
|
||||
+ 2: thread should clear LDT entry 0.
|
||||
+ 3: thread should exit. */
|
||||
+static atomic_uint ftx;
|
||||
+
|
||||
+static void *
|
||||
+threadproc (void *ctx)
|
||||
+{
|
||||
+ while (1)
|
||||
+ {
|
||||
+ futex ((int *) &ftx, FUTEX_WAIT, 1, NULL, NULL, 0);
|
||||
+ while (atomic_load (&ftx) != 2)
|
||||
+ {
|
||||
+ if (atomic_load (&ftx) >= 3)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ /* clear LDT entry 0. */
|
||||
+ const struct user_desc desc = { 0 };
|
||||
+ xmodify_ldt (1, &desc, sizeof (desc));
|
||||
+
|
||||
+ /* If ftx == 2, set it to zero, If ftx == 100, quit. */
|
||||
+ if (atomic_fetch_add (&ftx, -2) != 2)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/* As described in testcase, for historical reasons x86_32 Linux (and compat
|
||||
+ on x86_64) interprets SA_RESTORER clear with nonzero sa_restorer as a
|
||||
+ request for stack switching if the SS segment is 'funny' (this is default
|
||||
+ scenario for vDSO system). This means that anything that tries to mix
|
||||
+ signal handling with segmentation should explicit clear the sa_restorer.
|
||||
+
|
||||
+ This testcase check if sigaction in fact does it by changing the local
|
||||
+ descriptor table (LDT) through the modify_ldt syscall and triggering
|
||||
+ a synchronous segfault on iret fault by trying to install an invalid
|
||||
+ segment. With a correct zeroed sa_restorer it should not trigger an
|
||||
+ 'real' SEGSEGV and allows the siglongjmp in signal handler. */
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ setup_counter_page ();
|
||||
+ setup_low_user_desc ();
|
||||
+
|
||||
+ pthread_t thread;
|
||||
+ unsigned short orig_ss;
|
||||
+
|
||||
+ xsethandler (SIGSEGV, sigsegv_handler, 0);
|
||||
+ /* 32-bit kernels send SIGILL instead of SIGSEGV on IRET faults. */
|
||||
+ xsethandler (SIGILL, sigsegv_handler, 0);
|
||||
+
|
||||
+ thread = xpthread_create (0, threadproc, 0);
|
||||
+
|
||||
+ asm volatile ("mov %%ss, %0" : "=rm" (orig_ss));
|
||||
+
|
||||
+ for (int i = 0; i < 5; i++)
|
||||
+ {
|
||||
+ if (sigsetjmp (jmpbuf, 1) != 0)
|
||||
+ continue;
|
||||
+
|
||||
+ /* Make sure the thread is ready after the last test. */
|
||||
+ while (atomic_load (&ftx) != 0)
|
||||
+ ;
|
||||
+
|
||||
+ struct user_desc desc = {
|
||||
+ .entry_number = 0,
|
||||
+ .base_addr = 0,
|
||||
+ .limit = 0xffff,
|
||||
+ .seg_32bit = 1,
|
||||
+ .contents = 0,
|
||||
+ .read_exec_only = 0,
|
||||
+ .limit_in_pages = 1,
|
||||
+ .seg_not_present = 0,
|
||||
+ .useable = 0
|
||||
+ };
|
||||
+
|
||||
+ xmodify_ldt (0x11, &desc, sizeof (desc));
|
||||
+
|
||||
+ /* Arm the thread. */
|
||||
+ ftx = 1;
|
||||
+ futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
|
||||
+
|
||||
+ asm volatile ("mov %0, %%ss" : : "r" (0x7));
|
||||
+
|
||||
+ /* Fire up thread modify_ldt call. */
|
||||
+ atomic_store (&ftx, 2);
|
||||
+
|
||||
+ while (atomic_load (&ftx) != 0)
|
||||
+ ;
|
||||
+
|
||||
+ /* On success, modify_ldt will segfault us synchronously and we will
|
||||
+ escape via siglongjmp. */
|
||||
+ support_record_failure ();
|
||||
+ }
|
||||
+
|
||||
+ atomic_store (&ftx, 100);
|
||||
+ futex ((int*) &ftx, FUTEX_WAKE, 0, NULL, NULL, 0);
|
||||
+
|
||||
+ xpthread_join (thread);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#include <support/test-driver.c>
|
@ -1,42 +0,0 @@
|
||||
[BZ #23196]
|
||||
CVE-2018-11237
|
||||
* sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
|
||||
(L(preloop_large)): Save initial destination pointer in %r11 and
|
||||
use it instead of %rax after the loop.
|
||||
* string/test-mempcpy.c (MIN_PAGE_SIZE): Define.
|
||||
|
||||
Index: glibc-2.27/string/test-mempcpy.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/string/test-mempcpy.c
|
||||
+++ glibc-2.27/string/test-mempcpy.c
|
||||
@@ -18,6 +18,7 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define MEMCPY_RESULT(dst, len) (dst) + (len)
|
||||
+#define MIN_PAGE_SIZE 131072
|
||||
#define TEST_MAIN
|
||||
#define TEST_NAME "mempcpy"
|
||||
#include "test-string.h"
|
||||
Index: glibc-2.27/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
|
||||
+++ glibc-2.27/sysdeps/x86_64/multiarch/memmove-avx512-no-vzeroupper.S
|
||||
@@ -336,6 +336,7 @@ L(preloop_large):
|
||||
vmovups (%rsi), %zmm4
|
||||
vmovups 0x40(%rsi), %zmm5
|
||||
|
||||
+ mov %rdi, %r11
|
||||
/* Align destination for access with non-temporal stores in the loop. */
|
||||
mov %rdi, %r8
|
||||
and $-0x80, %rdi
|
||||
@@ -366,8 +367,8 @@ L(gobble_256bytes_nt_loop):
|
||||
cmp $256, %rdx
|
||||
ja L(gobble_256bytes_nt_loop)
|
||||
sfence
|
||||
- vmovups %zmm4, (%rax)
|
||||
- vmovups %zmm5, 0x40(%rax)
|
||||
+ vmovups %zmm4, (%r11)
|
||||
+ vmovups %zmm5, 0x40(%r11)
|
||||
jmp L(check)
|
||||
|
||||
L(preloop_large_bkw):
|
@ -1,19 +0,0 @@
|
||||
2018-03-01 DJ Delorie <dj@delorie.com>
|
||||
|
||||
[BZ #22342]
|
||||
* nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in
|
||||
key value.
|
||||
|
||||
Index: glibc-2.27/nscd/netgroupcache.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/nscd/netgroupcache.c
|
||||
+++ glibc-2.27/nscd/netgroupcache.c
|
||||
@@ -480,7 +480,7 @@ addinnetgrX (struct database_dyn *db, in
|
||||
{
|
||||
const char *group = key;
|
||||
key = (char *) rawmemchr (key, '\0') + 1;
|
||||
- size_t group_len = key - group - 1;
|
||||
+ size_t group_len = key - group;
|
||||
const char *host = *key++ ? key : NULL;
|
||||
if (host != NULL)
|
||||
key = (char *) rawmemchr (key, '\0') + 1;
|
@ -1,89 +0,0 @@
|
||||
2018-03-03 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
[BZ #22918]
|
||||
* nss/nsswitch.h (DEFINE_DATABASE): Don't define __nss_*_database.
|
||||
* nss/nsswitch.c (DEFINE_DATABASE): Define __nss_*_database here.
|
||||
* nscd/gai.c (__nss_hosts_database): Readd definition.
|
||||
* posix/tst-rfc3484.c (__nss_hosts_database): Likewise.
|
||||
* posix/tst-rfc3484-3.c (__nss_hosts_database): Likewise.
|
||||
* posix/tst-rfc3484-2.c (__nss_hosts_database): Likewise.
|
||||
|
||||
Index: glibc-2.27/nscd/gai.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/nscd/gai.c
|
||||
+++ glibc-2.27/nscd/gai.c
|
||||
@@ -45,3 +45,6 @@
|
||||
#ifdef HAVE_LIBIDN
|
||||
# include <libidn/idn-stub.c>
|
||||
#endif
|
||||
+
|
||||
+/* Some variables normally defined in libc. */
|
||||
+service_user *__nss_hosts_database attribute_hidden;
|
||||
Index: glibc-2.27/nss/nsswitch.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/nss/nsswitch.c
|
||||
+++ glibc-2.27/nss/nsswitch.c
|
||||
@@ -62,7 +62,7 @@ static service_library *nss_new_service
|
||||
|
||||
/* Declare external database variables. */
|
||||
#define DEFINE_DATABASE(name) \
|
||||
- extern service_user *__nss_##name##_database attribute_hidden; \
|
||||
+ service_user *__nss_##name##_database attribute_hidden; \
|
||||
weak_extern (__nss_##name##_database)
|
||||
#include "databases.def"
|
||||
#undef DEFINE_DATABASE
|
||||
Index: glibc-2.27/nss/nsswitch.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/nss/nsswitch.h
|
||||
+++ glibc-2.27/nss/nsswitch.h
|
||||
@@ -226,10 +226,10 @@ libc_hidden_proto (__nss_hostname_digits
|
||||
#define MAX_NR_ADDRS 48
|
||||
|
||||
/* Prototypes for __nss_*_lookup2 functions. */
|
||||
-#define DEFINE_DATABASE(arg) \
|
||||
- service_user *__nss_##arg##_database attribute_hidden; \
|
||||
- int __nss_##arg##_lookup2 (service_user **, const char *, \
|
||||
- const char *, void **); \
|
||||
+#define DEFINE_DATABASE(arg) \
|
||||
+ extern service_user *__nss_##arg##_database attribute_hidden; \
|
||||
+ int __nss_##arg##_lookup2 (service_user **, const char *, \
|
||||
+ const char *, void **); \
|
||||
libc_hidden_proto (__nss_##arg##_lookup2)
|
||||
#include "databases.def"
|
||||
#undef DEFINE_DATABASE
|
||||
Index: glibc-2.27/posix/tst-rfc3484-2.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/posix/tst-rfc3484-2.c
|
||||
+++ glibc-2.27/posix/tst-rfc3484-2.c
|
||||
@@ -58,6 +58,7 @@ _res_hconf_init (void)
|
||||
#undef USE_NSCD
|
||||
#include "../sysdeps/posix/getaddrinfo.c"
|
||||
|
||||
+service_user *__nss_hosts_database attribute_hidden;
|
||||
|
||||
/* This is the beginning of the real test code. The above defines
|
||||
(among other things) the function rfc3484_sort. */
|
||||
Index: glibc-2.27/posix/tst-rfc3484-3.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/posix/tst-rfc3484-3.c
|
||||
+++ glibc-2.27/posix/tst-rfc3484-3.c
|
||||
@@ -58,6 +58,7 @@ _res_hconf_init (void)
|
||||
#undef USE_NSCD
|
||||
#include "../sysdeps/posix/getaddrinfo.c"
|
||||
|
||||
+service_user *__nss_hosts_database attribute_hidden;
|
||||
|
||||
/* This is the beginning of the real test code. The above defines
|
||||
(among other things) the function rfc3484_sort. */
|
||||
Index: glibc-2.27/posix/tst-rfc3484.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/posix/tst-rfc3484.c
|
||||
+++ glibc-2.27/posix/tst-rfc3484.c
|
||||
@@ -58,6 +58,7 @@ _res_hconf_init (void)
|
||||
#undef USE_NSCD
|
||||
#include "../sysdeps/posix/getaddrinfo.c"
|
||||
|
||||
+service_user *__nss_hosts_database attribute_hidden;
|
||||
|
||||
/* This is the beginning of the real test code. The above defines
|
||||
(among other things) the function rfc3484_sort. */
|
@ -1,19 +0,0 @@
|
||||
2018-02-07 Igor Gnatenko <ignatenko@redhat.com>
|
||||
|
||||
[BZ #22797]
|
||||
* sysdeps/unix/sysv/linux/bits/mman-shared.h (pkey_get): Add
|
||||
missing second underscore to parameter name.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/bits/mman-shared.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/bits/mman-shared.h
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/bits/mman-shared.h
|
||||
@@ -61,7 +61,7 @@ int pkey_set (int __key, unsigned int __
|
||||
|
||||
/* Return the access rights for the current thread for KEY, which must
|
||||
have been allocated using pkey_alloc. */
|
||||
-int pkey_get (int _key) __THROW;
|
||||
+int pkey_get (int __key) __THROW;
|
||||
|
||||
/* Free an allocated protection key, which must have been allocated
|
||||
using pkey_alloc. */
|
@ -1,59 +0,0 @@
|
||||
2018-02-26 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
|
||||
|
||||
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Undefine Linux
|
||||
macros used in __ptrace_request.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
@@ -24,6 +24,49 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
+#if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H
|
||||
+/* Do not let Linux headers macros interfere with enum __ptrace_request. */
|
||||
+# undef PTRACE_ATTACH
|
||||
+# undef PTRACE_CONT
|
||||
+# undef PTRACE_DETACH
|
||||
+# undef PTRACE_GET_DEBUGREG
|
||||
+# undef PTRACE_GETEVENTMSG
|
||||
+# undef PTRACE_GETEVRREGS
|
||||
+# undef PTRACE_GETFPREGS
|
||||
+# undef PTRACE_GETREGS
|
||||
+# undef PTRACE_GETREGS64
|
||||
+# undef PTRACE_GETREGSET
|
||||
+# undef PTRACE_GETSIGINFO
|
||||
+# undef PTRACE_GETSIGMASK
|
||||
+# undef PTRACE_GETVRREGS
|
||||
+# undef PTRACE_GETVSRREGS
|
||||
+# undef PTRACE_INTERRUPT
|
||||
+# undef PTRACE_KILL
|
||||
+# undef PTRACE_LISTEN
|
||||
+# undef PTRACE_PEEKDATA
|
||||
+# undef PTRACE_PEEKSIGINFO
|
||||
+# undef PTRACE_PEEKTEXT
|
||||
+# undef PTRACE_POKEDATA
|
||||
+# undef PTRACE_POKETEXT
|
||||
+# undef PTRACE_SECCOMP_GET_FILTER
|
||||
+# undef PTRACE_SEIZE
|
||||
+# undef PTRACE_SET_DEBUGREG
|
||||
+# undef PTRACE_SETEVRREGS
|
||||
+# undef PTRACE_SETFPREGS
|
||||
+# undef PTRACE_SETOPTIONS
|
||||
+# undef PTRACE_SETREGS
|
||||
+# undef PTRACE_SETREGS64
|
||||
+# undef PTRACE_SETREGSET
|
||||
+# undef PTRACE_SETSIGINFO
|
||||
+# undef PTRACE_SETSIGMASK
|
||||
+# undef PTRACE_SETVRREGS
|
||||
+# undef PTRACE_SETVSRREGS
|
||||
+# undef PTRACE_SINGLEBLOCK
|
||||
+# undef PTRACE_SINGLESTEP
|
||||
+# undef PTRACE_SYSCALL
|
||||
+# undef PTRACE_TRACEME
|
||||
+#endif
|
||||
+
|
||||
/* Type of the REQUEST argument to `ptrace.' */
|
||||
enum __ptrace_request
|
||||
{
|
@ -1,95 +0,0 @@
|
||||
2018-02-26 Dmitry V. Levin <ldv@altlinux.org>
|
||||
|
||||
[BZ #22433]
|
||||
[BZ #22807]
|
||||
* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h (__ptrace_request): Add
|
||||
PTRACE_GETREGS, PTRACE_SETREGS, PTRACE_GETFPREGS, PTRACE_SETFPREGS,
|
||||
PTRACE_GETVRREGS, PTRACE_SETVRREGS, PTRACE_GETEVRREGS,
|
||||
PTRACE_SETEVRREGS, PTRACE_GETREGS64, PTRACE_SETREGS64,
|
||||
PTRACE_GET_DEBUGREG, PTRACE_SET_DEBUGREG, PTRACE_GETVSRREGS,
|
||||
PTRACE_SETVSRREGS, and PTRACE_SINGLEBLOCK.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
|
||||
@@ -112,6 +112,22 @@ enum __ptrace_request
|
||||
PTRACE_SINGLESTEP = 9,
|
||||
#define PT_STEP PTRACE_SINGLESTEP
|
||||
|
||||
+ /* Get all general purpose registers used by a process. */
|
||||
+ PTRACE_GETREGS = 12,
|
||||
+#define PT_GETREGS PTRACE_GETREGS
|
||||
+
|
||||
+ /* Set all general purpose registers used by a process. */
|
||||
+ PTRACE_SETREGS = 13,
|
||||
+#define PT_SETREGS PTRACE_SETREGS
|
||||
+
|
||||
+ /* Get all floating point registers used by a process. */
|
||||
+ PTRACE_GETFPREGS = 14,
|
||||
+#define PT_GETFPREGS PTRACE_GETFPREGS
|
||||
+
|
||||
+ /* Set all floating point registers used by a process. */
|
||||
+ PTRACE_SETFPREGS = 15,
|
||||
+#define PT_SETFPREGS PTRACE_SETFPREGS
|
||||
+
|
||||
/* Attach to a process that is already running. */
|
||||
PTRACE_ATTACH = 16,
|
||||
#define PT_ATTACH PTRACE_ATTACH
|
||||
@@ -120,10 +136,56 @@ enum __ptrace_request
|
||||
PTRACE_DETACH = 17,
|
||||
#define PT_DETACH PTRACE_DETACH
|
||||
|
||||
+ /* Get all altivec registers used by a process. */
|
||||
+ PTRACE_GETVRREGS = 18,
|
||||
+#define PT_GETVRREGS PTRACE_GETVRREGS
|
||||
+
|
||||
+ /* Set all altivec registers used by a process. */
|
||||
+ PTRACE_SETVRREGS = 19,
|
||||
+#define PT_SETVRREGS PTRACE_SETVRREGS
|
||||
+
|
||||
+ /* Get all SPE registers used by a process. */
|
||||
+ PTRACE_GETEVRREGS = 20,
|
||||
+#define PT_GETEVRREGS PTRACE_GETEVRREGS
|
||||
+
|
||||
+ /* Set all SPE registers used by a process. */
|
||||
+ PTRACE_SETEVRREGS = 21,
|
||||
+#define PT_SETEVRREGS PTRACE_SETEVRREGS
|
||||
+
|
||||
+ /* Same as PTRACE_GETREGS except a 32-bit process will obtain
|
||||
+ the full 64-bit registers. Implemented by 64-bit kernels only. */
|
||||
+ PTRACE_GETREGS64 = 22,
|
||||
+#define PT_GETREGS64 PTRACE_GETREGS64
|
||||
+
|
||||
+ /* Same as PTRACE_SETREGS except a 32-bit process will set
|
||||
+ the full 64-bit registers. Implemented by 64-bit kernels only. */
|
||||
+ PTRACE_SETREGS64 = 23,
|
||||
+#define PT_SETREGS64 PTRACE_SETREGS64
|
||||
+
|
||||
/* Continue and stop at the next entry to or return from syscall. */
|
||||
PTRACE_SYSCALL = 24,
|
||||
#define PT_SYSCALL PTRACE_SYSCALL
|
||||
|
||||
+ /* Get a debug register of a process. */
|
||||
+ PTRACE_GET_DEBUGREG = 25,
|
||||
+#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
|
||||
+
|
||||
+ /* Set a debug register of a process. */
|
||||
+ PTRACE_SET_DEBUGREG = 26,
|
||||
+#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
|
||||
+
|
||||
+ /* Get the first 32 VSX registers of a process. */
|
||||
+ PTRACE_GETVSRREGS = 27,
|
||||
+#define PT_GETVSRREGS PTRACE_GETVSRREGS
|
||||
+
|
||||
+ /* Set the first 32 VSX registers of a process. */
|
||||
+ PTRACE_SETVSRREGS = 28,
|
||||
+#define PT_SETVSRREGS PTRACE_SETVSRREGS
|
||||
+
|
||||
+ /* Execute process until next taken branch. */
|
||||
+ PTRACE_SINGLEBLOCK = 256,
|
||||
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
|
||||
+
|
||||
/* Set ptrace filter options. */
|
||||
PTRACE_SETOPTIONS = 0x4200,
|
||||
#define PT_SETOPTIONS PTRACE_SETOPTIONS
|
@ -1,129 +0,0 @@
|
||||
2018-05-09 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
|
||||
[BZ #22786]
|
||||
* stdlib/canonicalize.c (__realpath): Fix overflow in path length
|
||||
computation.
|
||||
* stdlib/Makefile (test-bz22786): New test.
|
||||
* stdlib/test-bz22786.c: New test.
|
||||
|
||||
Index: glibc-2.27/stdlib/Makefile
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/stdlib/Makefile
|
||||
+++ glibc-2.27/stdlib/Makefile
|
||||
@@ -84,7 +84,7 @@ tests := tst-strtol tst-strtod testmb t
|
||||
tst-cxa_atexit tst-on_exit test-atexit-race \
|
||||
test-at_quick_exit-race test-cxa_atexit-race \
|
||||
test-on_exit-race test-dlclose-exit-race \
|
||||
- tst-makecontext-align
|
||||
+ tst-makecontext-align test-bz22786
|
||||
|
||||
tests-internal := tst-strtod1i tst-strtod3 tst-strtod4 tst-strtod5i \
|
||||
tst-tls-atexit tst-tls-atexit-nodelete
|
||||
Index: glibc-2.27/stdlib/canonicalize.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/stdlib/canonicalize.c
|
||||
+++ glibc-2.27/stdlib/canonicalize.c
|
||||
@@ -181,7 +181,7 @@ __realpath (const char *name, char *reso
|
||||
extra_buf = __alloca (path_max);
|
||||
|
||||
len = strlen (end);
|
||||
- if ((long int) (n + len) >= path_max)
|
||||
+ if (path_max - n <= len)
|
||||
{
|
||||
__set_errno (ENAMETOOLONG);
|
||||
goto error;
|
||||
Index: glibc-2.27/stdlib/test-bz22786.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ glibc-2.27/stdlib/test-bz22786.c
|
||||
@@ -0,0 +1,90 @@
|
||||
+/* Bug 22786: test for buffer overflow in realpath.
|
||||
+ Copyright (C) 2018 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
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+/* This file must be run from within a directory called "stdlib". */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <limits.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <support/test-driver.h>
|
||||
+#include <libc-diag.h>
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ const char dir[] = "bz22786";
|
||||
+ const char lnk[] = "bz22786/symlink";
|
||||
+
|
||||
+ rmdir (dir);
|
||||
+ if (mkdir (dir, 0755) != 0 && errno != EEXIST)
|
||||
+ {
|
||||
+ printf ("mkdir %s: %m\n", dir);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+ if (symlink (".", lnk) != 0 && errno != EEXIST)
|
||||
+ {
|
||||
+ printf ("symlink (%s, %s): %m\n", dir, lnk);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ const size_t path_len = (size_t) INT_MAX + 1;
|
||||
+
|
||||
+ DIAG_PUSH_NEEDS_COMMENT;
|
||||
+#if __GNUC_PREREQ (7, 0)
|
||||
+ /* GCC 7 warns about too-large allocations; here we need such
|
||||
+ allocation to succeed for the test to work. */
|
||||
+ DIAG_IGNORE_NEEDS_COMMENT (7, "-Walloc-size-larger-than=");
|
||||
+#endif
|
||||
+ char *path = malloc (path_len);
|
||||
+ DIAG_POP_NEEDS_COMMENT;
|
||||
+
|
||||
+ if (path == NULL)
|
||||
+ {
|
||||
+ printf ("malloc (%zu): %m\n", path_len);
|
||||
+ return EXIT_UNSUPPORTED;
|
||||
+ }
|
||||
+
|
||||
+ /* Construct very long path = "bz22786/symlink/aaaa....." */
|
||||
+ char *p = mempcpy (path, lnk, sizeof (lnk) - 1);
|
||||
+ *(p++) = '/';
|
||||
+ memset (p, 'a', path_len - (path - p) - 2);
|
||||
+ p[path_len - (path - p) - 1] = '\0';
|
||||
+
|
||||
+ /* This call crashes before the fix for bz22786 on 32-bit platforms. */
|
||||
+ p = realpath (path, NULL);
|
||||
+
|
||||
+ if (p != NULL || errno != ENAMETOOLONG)
|
||||
+ {
|
||||
+ printf ("realpath: %s (%m)", p);
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ /* Cleanup. */
|
||||
+ unlink (lnk);
|
||||
+ rmdir (dir);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#define TEST_FUNCTION do_test
|
||||
+#include <support/test-driver.c>
|
@ -1,20 +0,0 @@
|
||||
[BZ #23005]
|
||||
* resolv/res_send.c (__res_context_send): Return ENOMEM if
|
||||
allocation of private copy of nsaddr_list fails.
|
||||
|
||||
Index: glibc-2.27/resolv/res_send.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/resolv/res_send.c
|
||||
+++ glibc-2.27/resolv/res_send.c
|
||||
@@ -471,6 +471,11 @@ __res_context_send (struct resolv_contex
|
||||
'\0',
|
||||
sizeof (struct sockaddr_in6)
|
||||
- sizeof (struct sockaddr_in));
|
||||
+ else
|
||||
+ {
|
||||
+ __set_errno (ENOMEM);
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
EXT(statp).nscount = statp->nscount;
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
2018-02-22 Andrew Waterman <andrew@sifive.com>
|
||||
|
||||
[BZ # 22884]
|
||||
* sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly.
|
||||
* sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise.
|
||||
* sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise.
|
||||
* sysdeps/riscv/rvf/s_fminf.c (__fminf): Likewise.
|
||||
|
||||
Index: glibc-2.27/sysdeps/riscv/rvd/s_fmax.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/riscv/rvd/s_fmax.c
|
||||
+++ glibc-2.27/sysdeps/riscv/rvd/s_fmax.c
|
||||
@@ -17,12 +17,19 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
+#include <math_private.h>
|
||||
#include <libm-alias-double.h>
|
||||
|
||||
double
|
||||
__fmax (double x, double y)
|
||||
{
|
||||
- asm ("fmax.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
|
||||
- return x;
|
||||
+ double res;
|
||||
+
|
||||
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
|
||||
+ return x + y;
|
||||
+ else
|
||||
+ asm ("fmax.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
|
||||
+
|
||||
+ return res;
|
||||
}
|
||||
libm_alias_double (__fmax, fmax)
|
||||
Index: glibc-2.27/sysdeps/riscv/rvd/s_fmin.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/riscv/rvd/s_fmin.c
|
||||
+++ glibc-2.27/sysdeps/riscv/rvd/s_fmin.c
|
||||
@@ -17,12 +17,19 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
+#include <math_private.h>
|
||||
#include <libm-alias-double.h>
|
||||
|
||||
double
|
||||
__fmin (double x, double y)
|
||||
{
|
||||
- asm ("fmin.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
|
||||
- return x;
|
||||
+ double res;
|
||||
+
|
||||
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
|
||||
+ return x + y;
|
||||
+ else
|
||||
+ asm ("fmin.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
|
||||
+
|
||||
+ return res;
|
||||
}
|
||||
libm_alias_double (__fmin, fmin)
|
||||
Index: glibc-2.27/sysdeps/riscv/rvf/s_fmaxf.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/riscv/rvf/s_fmaxf.c
|
||||
+++ glibc-2.27/sysdeps/riscv/rvf/s_fmaxf.c
|
||||
@@ -17,12 +17,19 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
+#include <math_private.h>
|
||||
#include <libm-alias-float.h>
|
||||
|
||||
float
|
||||
__fmaxf (float x, float y)
|
||||
{
|
||||
- asm ("fmax.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
|
||||
- return x;
|
||||
+ float res;
|
||||
+
|
||||
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
|
||||
+ return x + y;
|
||||
+ else
|
||||
+ asm ("fmax.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
|
||||
+
|
||||
+ return res;
|
||||
}
|
||||
libm_alias_float (__fmax, fmax)
|
||||
Index: glibc-2.27/sysdeps/riscv/rvf/s_fminf.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/riscv/rvf/s_fminf.c
|
||||
+++ glibc-2.27/sysdeps/riscv/rvf/s_fminf.c
|
||||
@@ -17,12 +17,19 @@
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <math.h>
|
||||
+#include <math_private.h>
|
||||
#include <libm-alias-float.h>
|
||||
|
||||
float
|
||||
__fminf (float x, float y)
|
||||
{
|
||||
- asm ("fmin.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
|
||||
- return x;
|
||||
+ float res;
|
||||
+
|
||||
+ if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
|
||||
+ return x + y;
|
||||
+ else
|
||||
+ asm ("fmin.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
|
||||
+
|
||||
+ return res;
|
||||
}
|
||||
libm_alias_float (__fmin, fmin)
|
@ -1,17 +0,0 @@
|
||||
2018-04-28 Aurelien Jarno <aurelien@aurel32.net>
|
||||
|
||||
[BZ #23069]
|
||||
* sysdeps/unix/sysv/linux/riscv/kernel_sigaction.h: New file.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/riscv/kernel_sigaction.h
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/riscv/kernel_sigaction.h
|
||||
@@ -0,0 +1,7 @@
|
||||
+/* This is the sigaction structure from the RISC-V Linux 4.15 kernel. */
|
||||
+
|
||||
+struct kernel_sigaction {
|
||||
+ __sighandler_t k_sa_handler;
|
||||
+ unsigned long sa_flags;
|
||||
+ sigset_t sa_mask;
|
||||
+};
|
@ -1,27 +0,0 @@
|
||||
2018-02-09 DJ Delorie <dj@redhat.com>
|
||||
|
||||
[BZ #22827]
|
||||
* sysdeps/unix/sysv/linux/riscv/readelflib.c (process_elf_file): Use
|
||||
64-bit ELF type for 64-bit ELF objects.
|
||||
|
||||
Index: glibc-2.27/sysdeps/unix/sysv/linux/riscv/readelflib.c
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/unix/sysv/linux/riscv/readelflib.c
|
||||
+++ glibc-2.27/sysdeps/unix/sysv/linux/riscv/readelflib.c
|
||||
@@ -43,6 +43,7 @@ process_elf_file (const char *file_name,
|
||||
{
|
||||
ElfW(Ehdr) *elf_header = (ElfW(Ehdr) *) file_contents;
|
||||
Elf32_Ehdr *elf32_header = (Elf32_Ehdr *) elf_header;
|
||||
+ Elf64_Ehdr *elf64_header = (Elf64_Ehdr *) elf_header;
|
||||
int ret;
|
||||
long flags;
|
||||
|
||||
@@ -59,7 +60,7 @@ process_elf_file (const char *file_name,
|
||||
{
|
||||
ret = process_elf64_file (file_name, lib, flag, osversion, soname,
|
||||
file_contents, file_length);
|
||||
- flags = elf32_header->e_flags;
|
||||
+ flags = elf64_header->e_flags;
|
||||
}
|
||||
|
||||
/* RISC-V linkers encode the floating point ABI as part of the ELF headers. */
|
@ -1,51 +0,0 @@
|
||||
2018-02-22 DJ Delorie <dj@delorie.com>
|
||||
|
||||
* sysdeps/riscv/tls-macros.h: Do not initialize $gp.
|
||||
|
||||
Index: glibc-2.27/sysdeps/riscv/tls-macros.h
|
||||
===================================================================
|
||||
--- glibc-2.27.orig/sysdeps/riscv/tls-macros.h
|
||||
+++ glibc-2.27/sysdeps/riscv/tls-macros.h
|
||||
@@ -23,19 +23,9 @@
|
||||
#include <sysdep.h>
|
||||
#include "dl-tls.h"
|
||||
|
||||
-#define LOAD_GP \
|
||||
- ".option push\n\t" \
|
||||
- ".option norelax\n\t" \
|
||||
- "la gp, __global_pointer$\n\t" \
|
||||
- ".option pop\n\t"
|
||||
-
|
||||
-#define UNLOAD_GP
|
||||
-
|
||||
#define TLS_GD(x) \
|
||||
({ void *__result; \
|
||||
- asm (LOAD_GP \
|
||||
- "la.tls.gd %0, " #x "\n\t" \
|
||||
- UNLOAD_GP \
|
||||
+ asm ("la.tls.gd %0, " #x "\n\t" \
|
||||
: "=r" (__result)); \
|
||||
__tls_get_addr (__result); })
|
||||
|
||||
@@ -43,19 +33,15 @@
|
||||
|
||||
#define TLS_IE(x) \
|
||||
({ void *__result; \
|
||||
- asm (LOAD_GP \
|
||||
- "la.tls.ie %0, " #x "\n\t" \
|
||||
+ asm ("la.tls.ie %0, " #x "\n\t" \
|
||||
"add %0, %0, tp\n\t" \
|
||||
- UNLOAD_GP \
|
||||
: "=r" (__result)); \
|
||||
__result; })
|
||||
|
||||
#define TLS_LE(x) \
|
||||
({ void *__result; \
|
||||
- asm (LOAD_GP \
|
||||
- "lui %0, %%tprel_hi(" #x ")\n\t" \
|
||||
+ asm ("lui %0, %%tprel_hi(" #x ")\n\t" \
|
||||
"add %0, %0, tp, %%tprel_add(" #x ")\n\t" \
|
||||
"addi %0, %0, %%tprel_lo(" #x ")\n\t" \
|
||||
- UNLOAD_GP \
|
||||
: "=r" (__result)); \
|
||||
__result; })
|
Loading…
Reference in New Issue
Block a user