summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* hurd if_index: Explicitly use AF_INET for if index discoverySamuel Thibault2022-02-031-3/+3
| | | | | | | | | 5bf07e1b3a74 ("Linux: Simplify __opensock and fix race condition [BZ #28353]") made __opensock try NETLINK then UNIX then INET. On the Hurd, only INET knows about network interfaces, so better actually specify that in if_index. (cherry picked from commit 1d3decee997ba2fc24af81803299b2f4f3c47063)
* Linux: Simplify __opensock and fix race condition [BZ #28353]Florian Weimer2022-02-034-159/+23
| | | | | | | | | | | | | | AF_NETLINK support is not quite optional on modern Linux systems anymore, so it is likely that the first attempt will always succeed. Consequently, there is no need to cache the result. Keep AF_UNIX and the Internet address families as a fallback, for the rare case that AF_NETLINK is missing. The other address families previously probed are totally obsolete be now, so remove them. Use this simplified version as the generic implementation, disabling Netlink support as needed. (cherry picked from commit 5bf07e1b3a74232bfb8332275110be1a5da50f83)
* linux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage [BZ #28850]Gleb Fotengauer-Malinovskiy2022-02-032-1/+2
| | | | | | | | | Pass the actual number of bytes returned by the kernel. Fixes: 33099d72e41c ("linux: Simplify get_nprocs") Reviewed-by: Dmitry V. Levin <ldv@altlinux.org> (cherry picked from commit 97ba273b505763325efd802dc3a9562dbba79579)
* tst-socket-timestamp-compat.c: Check __TIMESIZE [BZ #28837]H.J. Lu2022-02-011-1/+1
| | | | | | | time_t size is defined by __TIMESIZE, not __WORDSIZE. Check __TIMESIZE, instead of __WORDSIZE, for time_t size. This fixes BZ #28837. (cherry pick from commit 77a602ebb0769e7ccc5f9f8e06f7fffe66f69dfc)
* Linux: Only generate 64 bit timestamps for 64 bit time_t recvmsg/recvmmsgAdhemerval Zanella2022-02-016-26/+330
| | | | | | | | | | | | | | | | | | | | | | | | | The timestamps created by __convert_scm_timestamps only make sense for 64 bit time_t programs, 32 bit time_t programs will ignore 64 bit time_t timestamps since SO_TIMESTAMP will be defined to old values (either by glibc or kernel headers). Worse, if the buffer is not suffice MSG_CTRUNC is set to indicate it (which breaks some programs [1]). This patch makes only 64 bit time_t recvmsg and recvmmsg to call __convert_scm_timestamps. Also, the assumption to called it is changed from __ASSUME_TIME64_SYSCALLS to __TIMESIZE != 64 since the setsockopt might be called by libraries built without __TIME_BITS=64. The MSG_CTRUNC is only set for the 64 bit symbols, it should happen only if 64 bit time_t programs run older kernels. Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://github.com/systemd/systemd/pull/20567 Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 948ce73b31fdb0860bcec4b8e62b14e88234f98a)
* linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)Adhemerval Zanella2022-02-015-6/+351
| | | | | | | | | | | | | | | | | | | | | | The __convert_scm_timestamps only updates the control message last pointer for SOL_SOCKET type, so if the message control buffer contains multiple ancillary message types the converted timestamp one might overwrite a valid message. The test checks if the extra ancillary space is correctly handled by recvmsg/recvmmsg, where if there is no extra space for the 64-bit time_t converted message the control buffer should be marked with MSG_TRUNC. It also check if recvmsg/recvmmsg handle correctly multiple ancillary data. Checked on x86_64-linux and on i686-linux-gnu on both 5.11 and 4.15 kernel. Co-authored-by: Fabian Vogt <fvogt@suse.de> Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 8fba672472ae0055387e9315fc2eddfa6775ca79)
* support: Add support_socket_so_timestamp_time64Adhemerval Zanella2022-02-013-0/+53
| | | | | | | | | | Check if the socket support 64-bit network packages timestamps (SO_TIMESTAMP and SO_TIMESTAMPNS). This will be used on recvmsg and recvmmsg tests to check if the timestamp should be generated. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from 38bc0f4e78934aab455b31af05cefcbf3c22bece)
* x86: Use CHECK_FEATURE_PRESENT to check HLE [BZ #27398]H.J. Lu2022-02-011-1/+1
| | | | | | | HLE is disabled on blacklisted CPUs. Use CHECK_FEATURE_PRESENT, instead of CHECK_FEATURE_ACTIVE, to check HLE. (cherry picked from commit 501246c5e2dfcc278f0ebbdb72345cdd239521c7)
* x86: Black list more Intel CPUs for TSX [BZ #27398]H.J. Lu2022-02-011-3/+31
| | | | | | | | | | | Disable TSX and enable RTM_ALWAYS_ABORT for Intel CPUs listed in: https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html This fixes BZ #27398. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com> (cherry picked from commit 1e000d3d33211d5a954300e2a69b90f93f18a1a1)
* Fix glibc 2.34 ABI omission (missing GLIBC_2.34 in dynamic loader)Florian Weimer2022-01-3133-0/+66
| | | | | | | | | | | | | | The glibc 2.34 release really should have added a GLIBC_2.34 symbol to the dynamic loader. With it, we could move functions such as dlopen or pthread_key_create that work on process-global state into the dynamic loader (once we have fixed a longstanding issue with static linking). Without the GLIBC_2.34 symbol, yet another new symbol version would be needed because old glibc will fail to load binaries due to the missing symbol version in ld.so that newly linked programs will require. Reviewed-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit af121ae3e7cd12628c91ecfc46a9d65313a6e972)
* elf/Makefile: Reflow and sort most variable assignmentsFlorian Weimer2022-01-311-92/+296
| | | | | Reviewed-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit 7de01e60c200c431d3469deb784da8fd4508fc15)
* elf: Add a comment after trailing backslashesH.J. Lu2022-01-311-0/+4
| | | | (cherry picked from commit f4f70c2895e3d325188a42c10eb7bb4335be6773)
* elf: Sort tests and modules-namesH.J. Lu2022-01-311-127/+385
| | | | | | Sort tests and modules-names to reduce future conflicts. (cherry picked from commit 28713c06129f8f64f88c423266e6ff2880216509)
* NEWS: Add a bug entry for BZ #28755H.J. Lu2022-01-261-0/+1
|
* x86: Fix __wcsncmp_evex in strcmp-evex.S [BZ# 28755]Noah Goldstein2022-01-261-0/+10
| | | | | | | | | | | Fixes [BZ# 28755] for wcsncmp by redirecting length >= 2^56 to __wcscmp_evex. For x86_64 this covers the entire address range so any length larger could not possibly be used to bound `s1` or `s2`. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> (cherry picked from commit 7e08db3359c86c94918feb33a1182cd0ff3bb10b)
* x86: Fix __wcsncmp_avx2 in strcmp-avx2.S [BZ# 28755]Noah Goldstein2022-01-261-0/+10
| | | | | | | | | | | Fixes [BZ# 28755] for wcsncmp by redirecting length >= 2^56 to __wcscmp_avx2. For x86_64 this covers the entire address range so any length larger could not possibly be used to bound `s1` or `s2`. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com> (cherry picked from commit ddf0992cf57a93200e0c782e2a94d0733a5a0b87)
* NEWS: add bug entry for BZ #28769 and BZ #28770Aurelien Jarno2022-01-241-0/+2
|
* Linux: Detect user namespace support in io/tst-getcwd-smallbuffFlorian Weimer2022-01-241-0/+18
| | | | | | | Otherwise the test fails with certain container runtimes. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 5b8e7980c5dabd9aaefeba4f0208baa8cf7653ee)
* realpath: Avoid overwriting preexisting error (CVE-2021-3998)Siddhesh Poyarekar2022-01-241-1/+1
| | | | | | | | | | | Set errno and failure for paths that are too long only if no other error occurred earlier. Related: BZ #28770 Reviewed-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 84d2d0fe20bdf94feed82b21b4d7d136db471f03)
* getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)Siddhesh Poyarekar2022-01-244-1/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No valid path returned by getcwd would fit into 1 byte, so reject the size early and return NULL with errno set to ERANGE. This change is prompted by CVE-2021-3999, which describes a single byte buffer underflow and overflow when all of the following conditions are met: - The buffer size (i.e. the second argument of getcwd) is 1 byte - The current working directory is too long - '/' is also mounted on the current working directory Sequence of events: - In sysdeps/unix/sysv/linux/getcwd.c, the syscall returns ENAMETOOLONG because the linux kernel checks for name length before it checks buffer size - The code falls back to the generic getcwd in sysdeps/posix - In the generic func, the buf[0] is set to '\0' on line 250 - this while loop on line 262 is bypassed: while (!(thisdev == rootdev && thisino == rootino)) since the rootfs (/) is bind mounted onto the directory and the flow goes on to line 449, where it puts a '/' in the byte before the buffer. - Finally on line 458, it moves 2 bytes (the underflowed byte and the '\0') to the buf[0] and buf[1], resulting in a 1 byte buffer overflow. - buf is returned on line 469 and errno is not set. This resolves BZ #28769. Reviewed-by: Andreas Schwab <schwab@linux-m68k.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Qualys Security Advisory <qsa@qualys.com> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 23e0e8f5f1fb5ed150253d986ecccdc90c2dcd5e)
* tst-realpath-toolong: Fix hurd buildSiddhesh Poyarekar2022-01-241-0/+4
| | | | | | | Define PATH_MAX to a constant if it isn't already defined, like in hurd. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 976db046bc3a3738f69255ae00b0a09b8e77fd9c)
* realpath: Set errno to ENAMETOOLONG for result larger than PATH_MAX [BZ #28770]Siddhesh Poyarekar2022-01-244-2/+64
| | | | | | | | | | | | | | | realpath returns an allocated string when the result exceeds PATH_MAX, which is unexpected when its second argument is not NULL. This results in the second argument (resolved) being uninitialized and also results in a memory leak since the caller expects resolved to be the same as the returned value. Return NULL and set errno to ENAMETOOLONG if the result exceeds PATH_MAX. This fixes [BZ #28770], which is CVE-2021-3998. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit ee8d5e33adb284601c00c94687bc907e10aec9bb)
* stdlib: Fix formatting of tests list in MakefileSiddhesh Poyarekar2022-01-241-75/+77
| | | | | | Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit f9dab1b5f23d0fb008a56c7c6c8919adb49d3611)
* stdlib: Sort tests in MakefileSiddhesh Poyarekar2022-01-241-24/+75
| | | | | | | Put one test per line and sort them. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 5b766603efa727c236a5f0cdcf09b71ff60b7584)
* support: Add helpers to create paths longer than PATH_MAXSiddhesh Poyarekar2022-01-242-10/+160
| | | | | | | | | | Add new helpers support_create_and_chdir_toolong_temp_directory and support_chdir_toolong_temp_directory to create and descend into directory trees longer than PATH_MAX. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit fb7bff12e81c677a6622f724edd4d4987dd9d971)
* powerpc: Fix unrecognized instruction errors with recent binutilsPaul A. Clarke2022-01-182-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent versions of binutils (with commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a) stopped preserving "sticky" options across a base `.machine` directive, nullifying the use of passing "-many" through GCC to the assembler. As a result, some instructions which were recognized even under older, more stringent `.machine` directives become unrecognized instructions in that context. In `sysdeps/powerpc/tst-set_ppr.c`, the use of the `mfppr32` extended mnemonic became unrecognized, as the default compilation with GCC for 32bit powerpc adds a `.machine ppc` in the resulting assembly, so the command line option `-Wa,-many` is essentially ignored, and the ISA 2.06 instructions and mnemonics, like `mfppr32`, are unrecognized. The compilation of `sysdeps/powerpc/tst-set_ppr.c` fails with: Error: unrecognized opcode: `mfppr32' Add appropriate `.machine` directives in the assembly to bracket the `mfppr32` instruction. Part of a 2019 fix (commit 9250e6610fdb0f3a6f238d2813e319a41fb7a810) to the above test's Makefile to add `-many` to the compilation when GCC itself stopped passing `-many` to the assember no longer has any effect, so remove that. Reported-by: Joseph Myers <joseph@codesourcery.com> (cherry picked from commit ee874f44fd55988808a4a162ef21bfa2cc8dc6f7)
* x86: use default cache size if it cannot be determined [BZ #28784]Aurelien Jarno2022-01-172-4/+11
| | | | | | | | | | | | | | | | | | | | | | | In some cases (e.g QEMU, non-Intel/AMD CPU) the cache information can not be retrieved and the corresponding values are set to 0. Commit 2d651eb9265d ("x86: Move x86 processor cache info to cpu_features") changed the behaviour in such case by defining the __x86_shared_cache_size and __x86_data_cache_size variables to 0 instead of using the default values. This cause an issue with the i686 SSE2 optimized bzero/routine which assumes that the cache size is at least 128 bytes, and otherwise tries to zero/set the whole address space minus 128 bytes. Fix that by restoring the original code to only update __x86_shared_cache_size and __x86_data_cache_size variables if the corresponding cache sizes are not zero. Fixes bug 28784 Fixes commit 2d651eb9265d Reviewed-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit c242fcce06e3102ca663b2f992611d0bda4f2668)
* CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768)Florian Weimer2022-01-174-8/+51
| | | | | | | | The sunrpc function svcunix_create suffers from a stack-based buffer overflow with overlong pathname arguments. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit f545ad4928fa1f27a3075265182b38a4f939a5f7)
* sunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542)Martin Sebor2022-01-172-1/+48
| | | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit ef972a4c50014a16132b5c75571cfb6b30bef136)
* CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542)Florian Weimer2022-01-172-3/+14
| | | | | | | | Processing an overlong pathname in the sunrpc clnt_create function results in a stack-based buffer overflow. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit 226b46770c82899b555986583294b049c6ec9b40)
* socket: Add the __sockaddr_un_set functionFlorian Weimer2022-01-174-1/+120
| | | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> (cherry picked from commit e368b12f6c16b6888dda99ba641e999b9c9643c8)
* Disable debuginfod in printer tests [BZ #28757]H.J. Lu2022-01-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | With gdb-11.1-6.fc35.x86_64, I got FAIL: nptl/test-cond-printers FAIL: nptl/test-condattr-printers FAIL: nptl/test-mutex-printers FAIL: nptl/test-mutexattr-printers FAIL: nptl/test-rwlock-printers FAIL: nptl/test-rwlockattr-printers $ cat nptl/test-condattr-printers.out Error: Response does not match the expected pattern. Command: start Expected pattern: main Response: Temporary breakpoint 1 at 0x11d5: file test-condattr-printers.c, line 43. Starting program: /export/build/gnu/tools-build/glibc-cet-gitlab/build-x86_64-linux/nptl/test-condattr-printers This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.fedoraproject.org/ Enable debuginfod for this session? (y or [n]) Disable debuginfod to avoid GDB messages. This fixes BZ #28757. Reviewed-by: Florian Weimer <fweimer@redhat.com> (cherry picked from commit 7de501f9418bf099e7104b63b0e4423257981b14)
* Update syscall lists for Linux 5.16Joseph Myers2022-01-1426-2/+28
| | | | | | | | | | Linux 5.16 has one new syscall, futex_waitv. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py. (cherry picked from commit 4997a533ae4b51ef66a6b68862b7578a7acb82df)
* i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)Florian Weimer2022-01-135-255/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The configure check for CAN_USE_REGISTER_ASM_EBP tried to compile a simple function that uses %ebp as an inline assembly operand. If compilation failed, CAN_USE_REGISTER_ASM_EBP was set 0, which eventually had these consequences: (1) %ebx was avoided as an inline assembly operand, with an assembler macro hack to avoid unnecessary register moves. (2) %ebp was avoided as an inline assembly operand, using an out-of-line syscall function for 6-argument system calls. (1) is no longer needed for any GCC version that is supported for building glibc. %ebx can be used directly as a register operand. Therefore, this commit removes the %ebx avoidance completely. This avoids the assembler macro hack, which turns out to be incompatible with the current Systemtap probe macros (which switch to .altmacro unconditionally). (2) is still needed in many build configurations. The existing configure check cannot really capture that because the simple function succeeds to compile, while the full glibc build still fails. Therefore, this commit removes the check, the CAN_USE_REGISTER_ASM_EBP macro, and uses the out-of-line syscall function for 6-argument system calls unconditionally. Reviewed-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit a78e6a10d0b50d0ca80309775980fc99944b1727)
* Update syscall lists for Linux 5.15Joseph Myers2022-01-1328-4/+31
| | | | | | | | | | | | | | | | Linux 5.15 has one new syscall, process_mrelease (and also enables the clone3 syscall for RV32). It also has a macro __NR_SYSCALL_MASK for Arm, which is not a syscall but matches the pattern used for syscall macro names. Add __NR_SYSCALL_MASK to the names filtered out in the code dealing with syscall lists, update syscall-names.list for the new syscall and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py. (cherry picked from commit 3387c40a8bbad5faf85b1feb56429cb20feaa640)
* powerpc: Fix unrecognized instruction errors with recent GCCPaul A. Clarke2022-01-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Recent binutils commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a changes the behavior of `.machine` directives to override, rather than augment, the base CPU. This can result in _reduced_ functionality when, for example, compiling for default machine "power8", but explicitly asking for ".machine power5", which loses Altivec instructions. In tst-ucontext-ppc64-vscr.c, while the instructions provoking the new error messages are bracketed by ".machine power5", which is ostensibly Power ISA 2.03 (POWER5), the POWER5 processor did not support the VSX subset, so these instructions are not recognized as "power5". Error: unrecognized opcode: `vspltisb' Error: unrecognized opcode: `vpkuwus' Error: unrecognized opcode: `mfvscr' Error: unrecognized opcode: `stvx' Manually adding the VSX subset via ".machine altivec" is sufficient. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> (cherry picked from commit 064b475a2e5662b6b3973fabf505eade86e61510)
* timezone: test-case for BZ #28707Hans-Peter Nilsson2022-01-073-1/+69
| | | | | | | | | | | | | | | This test-case is the tzfile for Asuncion generated by tzlib-2021e as follows, using the tzlib-2021e zic: "zic -d DEST -r @1546300800 -L /dev/null -b slim SOURCE/southamerica". Note that in its type 2 header, it has two entries in its "time-types" array (types), but only one entry in its "transition types" array (type_idxs). * timezone/Makefile, timezone/tst-pr28707.c, timezone/testdata/gen-XT5.sh: New test. Co-authored-by: Christopher Wong <Christopher.Wong@axis.com> (cherry picked from commit ebe899af0dc3215159a9c896ac6f35b72a18cb6e)
* timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707)Hans-Peter Nilsson2022-01-072-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using a timezone file with a truncated starting time, generated by the zic in IANA tzcode-2021d a.k.a. tzlib-2021d (also in tzlib-2021e; current as of this writing), glibc asserts in __tzfile_read (on e.g. tzset() for this file) and you may find lines matching "tzfile.c:435: __tzfile_read: Assertion `num_types == 1' failed" in your syslog. One example of such a file is the tzfile for Asuncion generated by tzlib-2021e as follows, using the tzlib-2021e zic: "zic -d DEST -r @1546300800 -L /dev/null -b slim SOURCE/southamerica". Note that in its type 2 header, it has two entries in its "time-types" array (types), but only one entry in its "transition types" array (type_idxs). This is valid and expected already in the published RFC8536, and not even frowned upon: "Local time for timestamps before the first transition is specified by the first time type (time type 0)" ... "every nonzero local time type index SHOULD appear at least once in the transition type array". Note the "nonzero ... index". Until the 2021d zic, index 0 has been shared by the first valid transition but with 2021d it's separate, set apart as a placeholder and only "implicitly" indexed. (A draft update of the RFC mandates that the entry at index 0 is a placeholder in this case, hence can no longer be shared.) * time/tzfile.c (__tzfile_read): Don't assert when no transitions are found. Co-authored-by: Christopher Wong <Christopher.Wong@axis.com> (cherry picked from commit c36f64aa6dff13b12a1e03a185e75a50fa9f6a4c)
* Fix subscript error with odd TZif file [BZ #28338]Paul Eggert2022-01-072-3/+3
| | | | | | | | | * time/tzfile.c (__tzfile_compute): Fix unlikely off-by-one bug that accessed before start of an array when an oddball-but-valid TZif file was queried with an unusual time_t value. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> (cherry picked from commit 645277434a42efc547d2cac8bfede4da10b4049f)
* AArch64: Check for SVE in ifuncs [BZ #28744]Wilco Dijkstra2022-01-074-3/+4
| | | | | | | Add a check for SVE in the A64FX ifuncs for memcpy, memset and memmove. This fixes BZ #28744. (cherry picked from commit e5fa62b8db546f8792ec9e5c61e6419f4f8e3f4d)
* intl/plural.y: Avoid conflicting declarations of yyerror and yylexAndrea Monaco2021-12-231-0/+5
| | | | | | | | | | | | | | | | | bison-3.8 includes these lines in the generated intl/plural.c: #if !defined __gettexterror && !defined YYERROR_IS_DECLARED void __gettexterror (struct parse_args *arg, const char *msg); #endif #if !defined __gettextlex && !defined YYLEX_IS_DECLARED int __gettextlex (YYSTYPE *yylvalp, struct parse_args *arg); #endif Those default prototypes provided by bison conflict with the declarations later on in plural.y. This patch solves the issue. Reviewed-by: Arjun Shankar <arjun@redhat.com> (cherry picked from commit c6d7d6312c21bbcfb236d48bb7c11cedb234389f)
* Linux: Fix 32-bit vDSO for clock_gettime on powerpc32maminjie2021-12-211-1/+1
| | | | | | | | | | | | | | | | When the clock_id is CLOCK_PROCESS_CPUTIME_ID or CLOCK_THREAD_CPUTIME_ID, on the 5.10 kernel powerpc 32-bit, the 32-bit vDSO is executed successfully ( because the __kernel_clock_gettime in arch/powerpc/kernel/vdso32/gettimeofday.S does not support these two IDs, the 32-bit time_t syscall will be used), but tp32.tv_sec is equal to 0, causing the 64-bit time_t syscall to continue to be used, resulting in two system calls. Fix commit 72e84d1db22203e01a43268de71ea8669eca2863. Signed-off-by: maminjie <maminjie2@huawei.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> (cherry picked from commit e0fc721ce600038dd390e77cfe52440707ef574d)
* linux: Add sparck brk implementationAdhemerval Zanella2021-12-191-0/+58
| | | | | | | | | | | | | It turned that the generic implementation of brk() does not work for sparc, since on failure kernel will just return the previous input value without setting the conditional register. This patches adds back a sparc32 and sparc64 implementation removed by 720480934ab9107. Checked on sparc64-linux-gnu and sparcv9-linux-gnu. (cherry picked from commit 5b86241a032c50462988bdd1439e078384690d34)
* Update sparc libm-test-ulpsAdhemerval Zanella2021-12-181-1/+1
| | | | (cherry picked from commit c52eb066bc634a79e4194457362384abe5b43b3a)
* Update hppa libm-test-ulpsJohn David Anglin2021-12-171-1/+1
| | | | (cherry picked from commit d8cf84ac7e504663dfeb2bb45d8d48ae81effe05)
* riscv: align stack before calling _dl_init [BZ #28703]Aurelien Jarno2021-12-172-0/+7
| | | | | | | | | | | Align the stack pointer to 128 bits during the call to _dl_init() as specified by the RISC-V ABI [1]. This fixes the elf/tst-align2 test. Fixes bug 28703. [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc (cherry picked from commit 225da459cebef1037dcd78b56471edc0721e1c41)
* riscv: align stack in clone [BZ #28702]Aurelien Jarno2021-12-172-0/+4
| | | | | | | | | | | | | | The RISC-V ABI [1] mandates that "the stack pointer shall be aligned to a 128-bit boundary upon procedure entry". This as not the case in clone. This fixes the misc/tst-misalign-clone-internal and misc/tst-misalign-clone tests. Fixes bug 28702. [1] https://github.com/riscv-non-isa/riscv-elf-psabi-doc (cherry picked from commit d2e594d71509faf36cf851a69370db34a4f5fa65)
* powerpc64[le]: Allocate extra stack frame on syscall.SMatheus Castanho2021-12-171-0/+4
| | | | | | | | | | | | | | | The syscall function does not allocate the extra stack frame for scv like other assembly syscalls using DO_CALL_SCV. So after commit d120fb9941 changed the offset that is used to save LR, syscall ended up using an invalid offset, causing regressions on powerpc64. So make sure the extra stack frame is allocated in syscall.S as well to make it consistent with other uses of DO_CALL_SCV and avoid similar issues in the future. Tested on powerpc, powerpc64, and powerpc64le (with and without scv) Reviewed-by: Raphael M Zinsly <rzinsly@linux.ibm.com> (cherry picked from commit ae91d3df24a4a1b1f264d101a71a298bff310d14)
* elf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704]Aurelien Jarno2021-12-172-1/+9
| | | | | | | | | | | On KVM guests running on some AMD systems, the IBRS feature is reported as a synthetic feature using the Intel feature, while the cpuinfo entry keeps the same. Handle that by first checking the presence of the Intel feature on AMD systems. Fixes bug 28704. (cherry picked from commit 94058f6cde8b887178885954740ac6c866d25eab)
* nss: Use "files dns" as the default for the hosts database (bug 28700)Florian Weimer2021-12-174-6/+6
| | | | | | | | | | | | | | | | | | | This matches what is currently in nss/nsswitch.conf. The new ordering matches what most distributions use in their installed configuration files. It is common to add localhost to /etc/hosts because the name does not exist in the DNS, but is commonly used as a host name. With the built-in "dns [!UNAVAIL=return] files" default, dns is searched first and provides an answer for "localhost" (NXDOMAIN). We never look at the files database as a result, so the contents of /etc/hosts is ignored. This means that "getent hosts localhost" fail without a /etc/nsswitch.conf file, even though the host name is listed in /etc/hosts. Reviewed-by: Carlos O'Donell <carlos@redhat.com> (cherry picked from commit b99b0f93ee8762fe53ff65802deb6f00700b9924)