summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-06-29Disallow use of DES encryption functions in new programs.Zack Weinberg
The functions encrypt, setkey, encrypt_r, setkey_r, cbc_crypt, ecb_crypt, and des_setparity should not be used in new programs, because they use the DES block cipher, which is unacceptably weak by modern standards. Demote all of them to compatibility symbols, and remove their prototypes from installed headers. cbc_crypt, ecb_crypt, and des_setparity were already compat symbols when glibc was configured with --disable-obsolete-rpc. POSIX requires encrypt and setkey to be available when _XOPEN_CRYPT is defined, so this change also removes the definition of X_OPEN_CRYPT from <unistd.h>. The entire "DES Encryption" section is dropped from the manual, as is the mention of AUTH_DES and FIPS 140-2 in the introduction to crypt.texi. The documentation of 'memfrob' cross-referenced the DES Encryption section, which is replaced by a hyperlink to libgcrypt, and while I was in there I spruced up the actual documentation of 'memfrob' and 'strfry' a little. It's still fairly jokey, because those functions _are_ jokes, but they do also have real use cases, so people trying to use them for real should have all the information they need. DES-based authentication for Sun RPC is also insecure and should be deprecated or even removed, but maybe that can be left as TI-RPC's problem.
2018-06-29malloc: Update heap dumping/undumping comments [BZ #23351]Florian Weimer
Also remove a few now-unused declarations and definitions. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-06-29ast_ES: Add alternative month names (bug 23140).Rafal Luzynski
[BZ #23140] * localedata/locales/ast_ES (mon): Rename to... (alt_mon): This. (mon): Import from CLDR (genitive case).
2018-06-29getifaddrs: Don't return ifa entries with NULL names [BZ #21812]Daniel Alvarez
A lookup operation in map_newlink could turn into an insert because of holes in the interface part of the map. This leads to incorrectly set the name of the interface to NULL when the interface is not present for the address being processed (most likely because the interface was added between the RTM_GETLINK and RTM_GETADDR calls to the kernel). When such changes are detected by the kernel, it'll mark the dump as "inconsistent" by setting NLM_F_DUMP_INTR flag on the next netlink message. This patch checks this condition and retries the whole operation. Hopes are that next time the interface corresponding to the address entry is present in the list and correct name is returned.
2018-06-28Fix documentation build with old makeinfoSzabolcs Nagy
With old makeinfo '@code {' fails because of the extra space. * manual/llio.texi: Remove spurious space.
2018-06-28Use _STRUCT_TIMESPEC as guard in <bits/types/struct_timespec.h> [BZ #23349]Florian Weimer
After commit d76d3703551a362b472c866b5b6089f66f8daa8e ("Fix missing timespec definition for sys/stat.h (BZ #21371)") in combination with kernel UAPI changes, GCC sanitizer builds start to fail due to a conflicting definition of struct timespec in <linux/time.h>. Use _STRUCT_TIMESPEC as the header file inclusion guard, which is already checked in the kernel header, to support including <linux/time.h> and <sys/stat.h> in the same translation unit.
2018-06-28ldbl-128ibm-compat: Introduce ieee128 symbolsRajalakshmi Srinivasaraghavan
This patch adds __*ieee128 symbols for strfrom, strtold, strtold_l, wcstold and wcstold_l functions. Redirection from *l to *ieee128 will be handled in separate patch once we start building these new files. 2018-06-28 Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com> * sysdeps/ieee754/ldbl-128ibm-compat/Versions: Add __strfromieee128, __strtoieee128, __strtoieee128_l,__wcstoieee128 and __wcstoieee128_l. * sysdeps/ieee754/ldbl-128ibm-compat/strfromf128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/strtof128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/strtof128_l.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/wcstof128.c: New file. * sysdeps/ieee754/ldbl-128ibm-compat/wcstof128_l.c: New file.
2018-06-27nisplus: Correct pwent parsing issue and resulting build error [BZ #23266]Maciej W. Rozycki
Copy and null-terminate NIS+ password file UID and GID entries whose length is non-zero and are not terminated, in addition to empty ones, fixing a bug and a compilation issue causing an error with GCC 8: nss_nisplus/nisplus-parser.c: In function '_nss_nisplus_parse_pwent': nss_nisplus/nisplus-parser.c:90:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] strncpy (first_unused, numstr, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nss_nisplus/nisplus-parser.c:106:7: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] strncpy (first_unused, numstr, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ introduced with commit ac05397075f6: commit ac05397075f621cfdbe1db527c96167a58b6d18e Author: Ulrich Drepper <drepper@redhat.com> Date: Sun Apr 30 07:01:26 2006 +0000 * nis/nss_nisplus/nisplus-parser.c: Minor optimizations and cleanups. Avoid copying data if it can be used in the old place. (no mailing list reference available). Obviously regardless of the recently added compiler diagnostics causing a build error this code has been long non-functional, so I guess NIS+ servers have been supplying strings that are non-empty and have already been null-terminated. Which in turn made it unnecessary to make a null-terminated copy, masking this bug. [BZ #23266] * nis/nss_nisplus/nisplus-parser.c (_nss_nisplus_parse_pwent): Copy and null-terminate entries that are not terminated, in addition to empty ones.
2018-06-27Remove macros extend_alloca, extend_alloca_account [BZ #18023]Florian Weimer
The unused macro definition in posix/glob.c comes from gnulib and will have to be removed there.
2018-06-27Remove nptl/sockperf.c.Joseph Myers
This patch removes nptl/sockperf.c, an unused, x86-specific program with a hardcoded path in /tmp. If someone finds some of this code in future for adding a proper benchmark, that does not of course rule out adding it back in that form, but for now I think it's best to eliminate this code with the hardcoded /tmp path. Tested for x86_64. * nptl/sockperf.c: Remove file.
2018-06-27_dl_map_object_deps: Use struct scratch_buffer [BZ #18023]Florian Weimer
The function comment suggests that _dl_map_object_deps cannot use malloc, but it already allocates the l_initfini array on the heap, so the additional allocation should be acceptable.
2018-06-27gethostid (Linux variant): Switch to struct scratch_buffer [BZ #18023]Florian Weimer
Previously, extend_alloca was used without alloca accounting, which could have been problematic with large NSS results.
2018-06-27wordexp: Rewrite parse_tilde to use struct scratch_buffer [BZ #18023]Florian Weimer
2018-06-26Revert hurd errno.h changesAdhemerval Zanella
Patch 06ab719d30b01 wrongly added mach errno.h changes.
2018-06-26Fix hardcoded /tmp paths in testing (bug 13888).Joseph Myers
As noted in bug 13888, and as I noted previously in <https://sourceware.org/ml/libc-alpha/2000-10/msg00111.html>, various tests used hardcoded paths in /tmp, so posing issues for simultaneous test runs from different build directories. This patch fixes such uses of hardcoded file names to put them in the build directory instead (in the case of stdio-common/bug5 the file names are changed as well, to avoid a conflict with the name bug5.out also used for the automatic test output redirection). It also fixes test-installation.pl likewise (that was using filenames with $$ in them rather than strictly hardcoded names, but that's still not good practice for temporary file naming). Note that my list of files changed is not identical to that in bug 13888. I added tst-spawn3.c and test-installation.pl, and removed some tests that seem to me (now) to create temporary files securely (simply using /tmp is not itself a problem if the temporary files are handled properly with mkstemp; I haven't checked whether those tests used to do things insecurely). conformtest is not changed because the makefiles always pass a --tmpdir option so the /tmp default is irrelevant, and for the same reason there is no actual problem with nptl/tst-umask1.c because again the makefiles always override the default. nptl/sockperf.c is ignored because there is no code to run it; probably that file should actually be removed. Some tests use the mktemp function, but I think they all use it in a way that *is* secure (for generating names for directories / sockets / fifos / symlinks, where the operation using the name will not follow symlinks and so there is no potential for a symlink attack on the account running the testsuite). Some tests use the tmpnam function to generate temporary file names. This is in principle insecure, but not addressed by this patch (I consider it a separate issue from the fully hardcoded paths). Tested for x86_64. [BZ #13888] * posix/Makefile (CFLAGS-tst-spawn3.c): New variable. * posix/tst-spawn3.c (do_test): Put tst-spwan3.pid in OBJPFX, not /tmp. * scripts/test-installation.pl: Put temporary files in build directory, not /tmp. * stdio-common/Makefile (CFLAGS-bug3.c): New variable. (CFLAGS-bug4.c): Likewise. (CFLAGS-bug5.c): Likewise. (CFLAGS-test-fseek.c): Likewise. (CFLAGS-test-popen.c): Likewise. (CFLAGS-test_rdwr.c): Likewise. * stdio-common/bug3.c (main): Put temporary file in OBJPFX, not /tmp. * stdio-common/bug4.c (main): Likewise. * stdio-common/bug5.c (main): Likewise. * stdio-common/test-fseek.c (TESTFILE): Likewise. * stdio-common/test-popen.c (do_test): Likewise. * stdio-common/test_rdwr.c (main): Likewise.
2018-06-26In sem_open.c, pad was not initialized when __HAVE_64B_ATOMICS wasPatsy Franklin
true. On some arches this caused valgrind to warn about uninitialized bytes when the struct was written to the file system. This patch moves the initialization of pad outside of the conditional. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-06-26Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)Adhemerval Zanella
This patch fixes the OFD ("file private") locks for architectures that support non-LFS flock definition (__USE_FILE_OFFSET64 not defined). The issue in this case is both F_OFD_{GETLK,SETLK,SETLKW} and F_{SET,GET}L{W}K64 expects a flock64 argument and when using old F_OFD_* flags with a non LFS flock argument the kernel might interpret the underlying data wrongly. Kernel idea originally was to avoid using such flags in non-LFS syscall, but since GLIBC uses fcntl with LFS semantic as default it is possible to provide the functionality and avoid the bogus struct kernel passing by adjusting the struct manually for the required flags. The idea follows other LFS interfaces that provide two symbols: 1. A new LFS fcntl64 is added on default ABI with the usual macros to select it for FILE_OFFSET_BITS=64. 2. The Linux non-LFS fcntl use a stack allocated struct flock64 for F_OFD_{GETLK,SETLK,SETLKW} copy the results on the user provided struct. 3. Keep a compat symbol with old broken semantic for architectures that do not define __OFF_T_MATCHES_OFF64_T. So for architectures which defines __USE_FILE_OFFSET64, fcntl64 will aliased to fcntl and no adjustment would be required. So to actually use F_OFD_* with LFS support the source must be built with LFS support (_FILE_OFFSET_BITS=64). Also F_OFD_SETLKW command is handled a cancellation point, as for F_SETLKW{64}. Checked on x86_64-linux-gnu and i686-linux-gnu. [BZ #20251] * NEWS: Mention fcntl64 addition. * csu/check_fds.c: Replace __fcntl_nocancel by __fcntl64_nocancel. * login/utmp_file.c: Likewise. * sysdeps/posix/fdopendir.c: Likewise. * sysdeps/posix/opendir.c: Likewise. * sysdeps/unix/pt-fcntl.c: Likewise. * include/fcntl.h (__libc_fcntl64, __fcntl64, __fcntl64_nocancel_adjusted): New prototype. (__fcntl_nocancel_adjusted): Remove prototype. * io/Makefile (routines): Add fcntl64. (CFLAGS-fcntl64.c): New rule. * io/Versions [GLIBC_2.28] (fcntl64): New symbol. [GLIBC_PRIVATE] (__libc_fcntl): Rename to __libc_fcntl64. * io/fcntl.h (fcntl64): Add prototype and redirect if __USE_FILE_OFFSET64 is defined. * io/fcntl64.c: New file. * manual/llio.text: Add a note for which commands fcntl acts a cancellation point. * nptl/Makefile (CFLAGS-fcntl64.c): New rule. * sysdeps/mach/hurd/fcntl.c: Alias fcntl to fcntl64 symbols. * sysdeps/mach/hurd/i386/libc.abilist [GLIBC_2.28] (fcntl, fcntl64): New symbols. * sysdeps/unix/sysv/linux/fcntl.c (__libc_fcntl): Fix F_GETLK64, F_OFD_GETLK, F_SETLK64, F_SETLKW64, F_OFD_SETLK, and F_OFD_SETLKW for non-LFS case. * sysdeps/unix/sysv/linux/fcntl64.c: New file. * sysdeps/unix/sysv/linux/fcntl_nocancel.c (__fcntl_nocancel): Rename to __fcntl64_nocancel. (__fcntl_nocancel_adjusted): Rename to __fcntl64_nocancel_adjusted. * sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Rename to __fcntl64_nocancel. * sysdeps/unix/sysv/linux/tst-ofdlocks.c: New file. * sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise. * sysdeps/unix/sysv/linux/Makefile (tests): Add tst-ofdlocks. (tests-internal): Add tst-ofdlocks-compat. * sysdeps/unix/sysv/linux/aarch64/libc.abilist [GLIBC_2.28] (fcntl64): New symbol. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist [GLIBC_2.28] (fcntl, fcntl64): Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilis: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
2018-06-26Run thread shutdown functions in an explicit orderFlorian Weimer
This removes the __libc_thread_subfreeres hook in favor of explict calls. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-06-26sunrpc: Remove always-defined _RPC_THREAD_SAFE_ macroFlorian Weimer
Header and C source file changes were generated using: unifdef -m -D_RPC_THREAD_SAFE_ include/rpc/rpc.h sunrpc/*.c
2018-06-26libio: Add tst-vtables, tst-vtables-interposedFlorian Weimer
2018-06-26support: Add TEST_NO_SETVBUFFlorian Weimer
This is sometimes needed for testing stdio streams, where the setvbuf call in the test driver could interfere with the test.
2018-06-26libio: Disable vtable validation in case of interposition [BZ #23313]Florian Weimer
2018-06-25nss_files: Use struct scratch_buffer instead of extend_alloca [BZ #18023]Florian Weimer
2018-06-25getent: Use dynarray in initgroups_keys [BZ #18023]Florian Weimer
2018-06-25_nss_nis_initgroups_dyn: Use struct scratch_buffer [BZ #18023]Florian Weimer
Remove extend_alloca usage. Also adjusts the internal function get_uid.
2018-06-25getgrent_next_nss (compat-initgroups): Remove alloca fallback [BZ #18023]Florian Weimer
If the caller-supplied buffer is not large enough, fall back directly malloc. The previous __libc_use_alloca check was incorrect because it did not take into account that extend_alloca may fail to merge allocations, so it would underestimate the stack space being used by roughly a factor of two.
2018-06-25nscd: Switch to struct scratch_buffer in adhstaiX [BZ #18023]Florian Weimer
The pre-allocation of the three scratch buffers increased the initial stack size somewhat, but if retries are needed, the previous version used more stack space if extend_alloca could not merge allocations. Lack of alloca accounting also means could be problematic with extremely large NSS responses, too. [BZ #18023] * nscd/aicache.c (addhstaiX): Use struct scratch_buffer instead of extend_alloca.
2018-06-25nscd: Use struct scratch_buffer, not extend_alloca in most caches [BZ #18023]Florian Weimer
This replaces the ERANGE retry loops with loops which have heap fallback. Heap allocation might actually be required for extremely large NSS results.
2018-06-25nscd restart: Use malloc instead of extend_alloca [BZ #18023]Florian Weimer
This introduces a separate function, read_cmdline, which reads the contents of /proc/self/cmdline into a heap-allocated buffer.
2018-06-25csb_PL: Add alternative month names (bug 23140).Rafal Luzynski
Kashubian language is not supported by CLDR, data copied from Wikipedia and documents released by RJK (official Kashubian Language Council), also consulted with a native speaker. Note that this language also needs ab_alt_mon feature due to the month May: nominative "môj", genitive "maja"; abbreviated nominative "môj", abbreviated genitive "maj". [BZ #23140] * localedata/locales/csb_PL (mon): Rename to... (alt_mon): This. (abmon): Rename to... (ab_alt_mon): This. (mon): Add with proper genitive forms, copy from Wikipedia. (abmon): Likewise.
2018-06-25csb_PL: Update month translations + add yesstr/nostr (bug 19485).Rafal Luzynski
Thank you Michal Ostrowski for the feedback. [BZ #19485] * localedata/locales/csb_PL (mon): Fix typos: "łżëkwiôt" -> "łżëkwiat" (April); "lëpinc" -> "lëpińc" (July). (yesstr): Add, value is "jo". (nostr): Add, value is "nié".
2018-06-22m68k: Reorganize log1p and significand implementationsTulio Magno Quites Machado Filho
Commit 5e79e0292bfb03f40e43379fd92581ad8eae9cb8 broke m68k after s_significand.c became available in the build directory. All m68k implementations of log1p and significand were including s_significand.c and stopped working after the inclusion of the the auto-generated file. This patch reorganizes the implementation of log1p and significand for m680x0 in order to avoid hitting this problem. * sysdeps/m68k/m680x0/fpu/s_log1p.c: Set as the generic file for all log1p and significand functions on m680x0. * sysdeps/m68k/m680x0/fpu/s_log1pf.c: Include s_log1p.c instead of s_significand.c.. * sysdeps/m68k/m680x0/fpu/s_log1pl.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significandf.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significandl.c: Likewise. * sysdeps/m68k/m680x0/fpu/s_significand.c: Move all the code to s_log1p.c and include it.. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-06-21Add Andes nds32 dynamic relocations to elf.hVincent Chen
* elf/elf.h (R_NDS32_NONE): New define. (R_NDS32_32_RELA): Likewise. (R_NDS32_COPY): Likewise. (R_NDS32_GLOB_DAT): Likewise. (R_NDS32_JUMP_SLOT): Likewise. (R_NDS32_RELATIVE): Likewise. (R_NDS32_TLS_TPOFF): Likewise. (R_NDS32_TLS_DESC): Likewise.
2018-06-21elf.h: Add BPF relocation types.Mark Wielaard
The BPF ELF format has new relocation types R_BPF_64_64 and R_BPF_64_32. The existing R_BPF_MAP_FD was an extension that never got implemented. Remove it, because the constant conflicts with the official R_BPF_64_64. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-06-21math: Set 387 and SSE2 rounding mode for tgamma on i386 [BZ #23253]Florian Weimer
Previously, only the SSE2 rounding mode was set, so the assembler implementations using 387 were not following the expecting rounding mode.
2018-06-20Fix tst-cmp.c build with GCC mainline.Joseph Myers
Building the testsuite with GCC mainline fails with -Wstringop-overflow= errors in string/tst-cmp.c. These are for calls to strncmp and strncasecmp with SIZE_MAX size argument. The tests are deliberately using this size that would be dubious in normal code, so this patch disables the warning for the calls in question. Tested with build-many-glibcs.py for aarch64-linux-gnu. * string/tst-cmp.c: Include <libc-diag.h>. (strncmp_max): Disable -Wstringop-overflow= around call to strncmp. (strncasecmp_max): Disable -Wstringop-overflow= around call to strncasecmp.
2018-06-20Fix bug-strspn1.c, bug-strpbrk1.c build with GCC mainline.Joseph Myers
Building the testsuite with GCC mainline fails with: bug-strspn1.c: In function 'main': bug-strspn1.c:14:3: error: right-hand operand of comma expression has no effect [-Werror=unused-value] strspn (b++, ""); ^~~~~~~~~~~~~~~~ and a similar error for bug-strpbrk1.c. I'm not sure what GCC change introduced this, and the wording of the message is a bit off (in the source it's not a comma expression, that must reflect GCC's IR). But the warning is correct (strspn is a pure function, the call is useless, and if there wasn't an argument with a side effect much older GCC would have warned); the point of the test is to verify that the side effect in an argument still occurs for this useless call that can otherwise be optimized to an (unused) constant (testing for a bug there once was in an old strspn macro). This patch duly arranges for the warning to be disabled for this code. Tested with build-many-glibcs.py for aarch64-linux-gnu. * string/bug-strpbrk1.c: Include <libc-diag.h>. (main): Disable -Wunused-value around call to strpbrk. * string/bug-strspn1.c: Include <libc-diag.h>. (main): Disable -Wunused-value around call to strspn.
2018-06-20ldbl-128ibm-compat: Create libm-alias-float128.hTulio Magno Quites Machado Filho
Add a new libm-alias-float128.h in order to provide the __*ieee128 aliases for the existing *f128 that do not have a globally exported symbol. * sysdeps/ieee754/ldbl-128ibm-compat/Versions: New file. * sysdeps/ieee754/ldbl-128ibm-compat/libm-alias-float128.h: New file.
2018-06-20Add a generic significand implementationTulio Magno Quites Machado Filho
Create a template for significand. * math/Makefile (libm-calls): Move s_significandF to... (gen-libm-calls): ... here. * math/s_significand_template.c: New file. * math/s_significand.c: Removed. * math/s_significandf.c: Removed. * math/s_significandl.c: Removed. * sysdeps/ieee754/ldbl-opt/s_significand.c: Removed. * sysdeps/ieee754/ldbl-opt/s_significandl.c: Removed. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-06-20Move declare_mgen_finite_alias definitionTulio Magno Quites Machado Filho
Move declare_mgen_finite_alias, declare_mgen_finite_alias_s and declare_mgen_finite_alias_x to a shared place in order to reuse them in other files that also declare _finite aliases. * math/e_exp2_template.c (declare_mgen_finite_alias, declare_mgen_finite_alias_s, declare_mgen_finite_alias_x): Move to... * sysdeps/generic/math-type-macros.h (declare_mgen_finite_alias, declare_mgen_finite_alias_s, declare_mgen_finite_alias_x): ... here. Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
2018-06-20libio: Avoid ptrdiff_t overflow in IO_validate_vtableFlorian Weimer
If the candidate pointer is sufficiently far away from __start___libc_IO_vtables, the result might not fit into ptrdiff_t.
2018-06-19Fix scanf rounding of negative floating-point numbers (bug 23280).Joseph Myers
As reported in bug 23280, scanf functions produce incorrectly rounded result for floating-point formats in FE_UPWARD and FE_DOWNWARD modes, because they pass the input with sign removed to strtod functions, and then negate the result if there was a '-' at the start of the input. This patch fixes this by arranging for the sign to be passed to strtod rather than scanf doing the negation itself. In turn, keeping the sign around in the buffer being built up for strtod requires updating places that examine char_buffer_size (&charbuf) to allow for the sign being there as an extra character. Tested for x86_64. [BZ #23280] * stdio-common/vfscanf.c (_IO_vfscanf_internal): Pass sign of floating-point number to strtod functions rather than possibly negating result of those functions. * stdio-common/tst-scanf-round.c: New file. * stdio-common/Makefile (tests): Add tst-scanf-round. ($(objpfx)tst-scanf-round): Depend on $(libm).
2018-06-19hurd: fix localplt.data formatSamuel Thibault
* sysdeps/mach/hurd/i386/localplt.data: Drop empty line.
2018-06-19hurd: Fix "Missing required PLT reference"Samuel Thibault
* sysdeps/mach/hurd/localplt.data: Move to... * sysdeps/mach/hurd/i386/localplt.data: new file. Add + REL R_386_GLOB_DAT like on Linux i386.
2018-06-18Add SHM_STAT_ANY from Linux 4.17 to bits/shm.h.Joseph Myers
Linux 4.17 adds a SHM_STAT_ANY constant (ipcs command). This patch adds it to the relevant bits/shm.h headers. Tested for x86_64. * sysdeps/unix/sysv/linux/alpha/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): New macro. * sysdeps/unix/sysv/linux/arm/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/generic/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/mips/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/s390/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/sh/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/x86/bits/shm.h [__USE_MISC] (SHM_STAT_ANY): Likewise.
2018-06-18Add SEM_STAT_ANY from Linux 4.17 to bits/sem.h.Joseph Myers
Linux 4.17 adds a SEM_STAT_ANY constant (ipcs command). This patch adds it to the relevant bits/sem.h headers. Tested for x86_64. * sysdeps/unix/sysv/linux/alpha/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): New macro. * sysdeps/unix/sysv/linux/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/generic/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/mips/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/s390/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/x86/bits/sem.h [__USE_MISC] (SEM_STAT_ANY): Likewise.
2018-06-18Add MSG_STAT_ANY from Linux 4.17 to bits/msq.h.Joseph Myers
Linux 4.17 adds a MSG_STAT_ANY constant (ipcs command). This patch adds it to the relevant bits/msq.h headers. Tested for x86_64. * sysdeps/unix/sysv/linux/alpha/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): New macro. * sysdeps/unix/sysv/linux/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/generic/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/hppa/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/ia64/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/mips/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/s390/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/sparc/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise. * sysdeps/unix/sysv/linux/x86/bits/msq.h [__USE_MISC] (MSG_STAT_ANY): Likewise.
2018-06-18Update MAP_TYPE value for hppa from Linux 4.17.Joseph Myers
This patch updates the hppa definition of MAP_TYPE to reflect a corresponding change in the Linux kernel in 4.17 (so the value now has four bits set, as it does on other architectures, although they are different from other architectures because of hppa differences in other MAP_* bits). Tested with build-many-glibcs.py for hppa. * sysdeps/unix/sysv/linux/hppa/bits/mman.h [__USE_MISC] (MAP_TYPE): Change value to 0x2b.
2018-06-18Linux: Create Netlink socket with SOCK_CLOEXEC in __check_pf [BZ #15722]Florian Weimer
2018-06-18Fix powerpc64le build of nan-sign tests (bug 23303).Joseph Myers
My recent nan-sign tests fail to build for powerpc64le with GCC 8 because of the special compile / link options needed there for any test using _Float128. This patch arranges for these tests to be handled on powerpc64le similarly to other such tests. Tested with build-many-glibcs.py for powerpc64le. [BZ #23303] * sysdeps/powerpc/powerpc64/le/Makefile (CFLAGS-tst-strtod-nan-sign.c): Add -mfloat128. (CFLAGS-tst-wcstod-nan-sign.c): Likewise. (gnulib-tests): Also add $(f128-loader-link) for tst-strtod-nan-sign abd tst-wcstod-nan-sign.