]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
3 years agostdlib: Sort tests in Makefile
Siddhesh Poyarekar [Thu, 13 Jan 2022 05:04:37 +0000 (10:34 +0530)] 
stdlib: Sort tests in Makefile

Put one test per line and sort them.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit 5b766603efa727c236a5f0cdcf09b71ff60b7584)

3 years agosupport: Add helpers to create paths longer than PATH_MAX
Siddhesh Poyarekar [Tue, 18 Jan 2022 07:59:36 +0000 (13:29 +0530)] 
support: Add helpers to create paths longer than PATH_MAX

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)

3 years agopowerpc: Fix unrecognized instruction errors with recent binutils
Paul A. Clarke [Sat, 25 Sep 2021 14:57:15 +0000 (09:57 -0500)] 
powerpc: Fix unrecognized instruction errors with recent binutils

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)

3 years agox86: use default cache size if it cannot be determined [BZ #28784]
Aurelien Jarno [Mon, 17 Jan 2022 18:41:40 +0000 (19:41 +0100)] 
x86: use default cache size if it cannot be determined [BZ #28784]

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)

3 years agoCVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768)
Florian Weimer [Mon, 17 Jan 2022 10:49:25 +0000 (11:49 +0100)] 
CVE-2022-23218: Buffer overflow in sunrpc svcunix_create (bug 28768)

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)

3 years agosunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542)
Martin Sebor [Mon, 17 Jan 2022 09:21:34 +0000 (10:21 +0100)] 
sunrpc: Test case for clnt_create "unix" buffer overflow (bug 22542)

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit ef972a4c50014a16132b5c75571cfb6b30bef136)

3 years agoCVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542)
Florian Weimer [Mon, 17 Jan 2022 09:21:34 +0000 (10:21 +0100)] 
CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" (bug 22542)

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)

3 years agosocket: Add the __sockaddr_un_set function
Florian Weimer [Mon, 17 Jan 2022 09:21:34 +0000 (10:21 +0100)] 
socket: Add the __sockaddr_un_set function

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit e368b12f6c16b6888dda99ba641e999b9c9643c8)

3 years agoDisable debuginfod in printer tests [BZ #28757]
H.J. Lu [Sun, 9 Jan 2022 17:06:15 +0000 (09:06 -0800)] 
Disable debuginfod in printer tests [BZ #28757]

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)

3 years agoUpdate syscall lists for Linux 5.16
Joseph Myers [Thu, 13 Jan 2022 22:18:13 +0000 (22:18 +0000)] 
Update syscall lists for Linux 5.16

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)

3 years agoi386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)
Florian Weimer [Thu, 13 Jan 2022 13:59:29 +0000 (14:59 +0100)] 
i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)

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)

3 years agoUpdate syscall lists for Linux 5.15
Joseph Myers [Wed, 10 Nov 2021 15:21:19 +0000 (15:21 +0000)] 
Update syscall lists for Linux 5.15

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)

3 years agopowerpc: Fix unrecognized instruction errors with recent GCC
Paul A. Clarke [Tue, 14 Sep 2021 18:13:33 +0000 (13:13 -0500)] 
powerpc: Fix unrecognized instruction errors with recent GCC

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)

3 years agotimezone: test-case for BZ #28707
Hans-Peter Nilsson [Fri, 17 Dec 2021 20:45:54 +0000 (21:45 +0100)] 
timezone: test-case for BZ #28707

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)

3 years agotimezone: handle truncated timezones from tzcode-2021d and later (BZ #28707)
Hans-Peter Nilsson [Fri, 17 Dec 2021 20:38:00 +0000 (21:38 +0100)] 
timezone: handle truncated timezones from tzcode-2021d and later (BZ #28707)

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)

3 years agoFix subscript error with odd TZif file [BZ #28338]
Paul Eggert [Tue, 14 Sep 2021 05:49:45 +0000 (22:49 -0700)] 
Fix subscript error with odd TZif file [BZ #28338]

* 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)

3 years agoAArch64: Check for SVE in ifuncs [BZ #28744]
Wilco Dijkstra [Thu, 6 Jan 2022 14:36:28 +0000 (14:36 +0000)] 
AArch64: Check for SVE in ifuncs [BZ #28744]

Add a check for SVE in the A64FX ifuncs for memcpy, memset and memmove.
This fixes BZ #28744.

(cherry picked from commit e5fa62b8db546f8792ec9e5c61e6419f4f8e3f4d)

3 years agointl/plural.y: Avoid conflicting declarations of yyerror and yylex
Andrea Monaco [Sun, 12 Dec 2021 09:24:28 +0000 (10:24 +0100)] 
intl/plural.y: Avoid conflicting declarations of yyerror and yylex

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)

3 years agoLinux: Fix 32-bit vDSO for clock_gettime on powerpc32
maminjie [Mon, 20 Dec 2021 11:36:32 +0000 (19:36 +0800)] 
Linux: Fix 32-bit vDSO for clock_gettime on powerpc32

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)

3 years agolinux: Add sparck brk implementation
Adhemerval Zanella [Wed, 4 Aug 2021 18:34:12 +0000 (21:34 +0300)] 
linux: Add sparck brk implementation

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)

3 years agoUpdate sparc libm-test-ulps
Adhemerval Zanella [Wed, 4 Aug 2021 18:40:32 +0000 (21:40 +0300)] 
Update sparc libm-test-ulps

(cherry picked from commit c52eb066bc634a79e4194457362384abe5b43b3a)

3 years agoUpdate hppa libm-test-ulps
John David Anglin [Mon, 6 Sep 2021 17:37:29 +0000 (17:37 +0000)] 
Update hppa libm-test-ulps

(cherry picked from commit d8cf84ac7e504663dfeb2bb45d8d48ae81effe05)

3 years agoriscv: align stack before calling _dl_init [BZ #28703]
Aurelien Jarno [Wed, 15 Dec 2021 23:06:28 +0000 (00:06 +0100)] 
riscv: align stack before calling _dl_init [BZ #28703]

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)

3 years agoriscv: align stack in clone [BZ #28702]
Aurelien Jarno [Tue, 14 Dec 2021 21:44:35 +0000 (22:44 +0100)] 
riscv: align stack in clone [BZ #28702]

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)

3 years agopowerpc64[le]: Allocate extra stack frame on syscall.S
Matheus Castanho [Wed, 1 Dec 2021 14:14:40 +0000 (11:14 -0300)] 
powerpc64[le]: Allocate extra stack frame on syscall.S

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)

3 years agoelf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704]
Aurelien Jarno [Wed, 15 Dec 2021 22:46:19 +0000 (23:46 +0100)] 
elf: Fix tst-cpu-features-cpuinfo for KVM guests on some AMD systems [BZ #28704]

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)

3 years agonss: Use "files dns" as the default for the hosts database (bug 28700)
Florian Weimer [Fri, 17 Dec 2021 11:01:20 +0000 (12:01 +0100)] 
nss: Use "files dns" as the default for the hosts database (bug 28700)

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)

3 years agoarm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro
Florian Weimer [Fri, 17 Dec 2021 10:48:41 +0000 (11:48 +0100)] 
arm: Guard ucontext _rtld_global_ro access by SHARED, not PIC macro

Due to PIE-by-default, PIC is now defined in more cases.  libc.a
does not have _rtld_global_ro, and statically linking setcontext
fails.  SHARED is the right condition to use, so that libc.a
references _dl_hwcap instead of _rtld_global_ro.

For static PIE support, the !SHARED case would still have to be made
PIC.  This patch does not achieve that.

Fixes commit 23645707f12f2dd9d80b51effb2d9618a7b65565
("Replace --enable-static-pie with --disable-default-pie").

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit ce1e5b11229f19820b86f8b19d651f16009552b0)

3 years agomips: increase stack alignment in clone to match the ABI
Xi Ruoyao [Fri, 13 Aug 2021 16:01:14 +0000 (16:01 +0000)] 
mips: increase stack alignment in clone to match the ABI

In "mips: align stack in clone [BZ #28223]"
(commit 1f51cd9a860ee45eee8a56fb2ba925267a2a7bfe) I made a mistake: I
misbelieved one "word" was 2-byte and "doubleword" should be 4-byte.
But in MIPS ABI one "word" is defined 32-bit (4-byte), so "doubleword" is
8-byte [1], and "quadword" is 16-byte [2].

[1]: "System V Application Binary Interface: MIPS(R) RISC Processor
      Supplement, 3rd edition", page 3-31
[2]: "MIPSpro(TM) 64-Bit Porting and Transition Guide", page 23

(cherry picked from commit 0f62fe053273ff6c62ac95c59b7687c964737b00)

3 years agomips: align stack in clone [BZ #28223]
Xi Ruoyao [Thu, 12 Aug 2021 20:31:59 +0000 (20:31 +0000)] 
mips: align stack in clone [BZ #28223]

The MIPS O32 ABI requires 4 byte aligned stack, and the MIPS N64 and N32
ABI require 8 byte aligned stack.  Previously if the caller passed an
unaligned stack to clone the the child misbehaved.

Fixes bug 28223.

(cherry picked from commit 1f51cd9a860ee45eee8a56fb2ba925267a2a7bfe)

3 years agopthread/tst-cancel28: Fix barrier re-init race condition
Stafford Horne [Sat, 25 Sep 2021 08:02:06 +0000 (17:02 +0900)] 
pthread/tst-cancel28: Fix barrier re-init race condition

When running this test on the OpenRISC port I am working on this test
fails with a timeout.  The test passes when being straced or debugged.
Looking at the code there seems to be a race condition in that:

  1 main thread: calls xpthread_cancel
  2 sub thread : receives cancel signal
  3 sub thread : cleanup routine waits on barrier
  4 main thread: re-inits barrier
  5 main thread: waits on barrier

After getting to 5 the main thread and sub thread wait forever as the 2
barriers are no longer the same.

Removing the barrier re-init seems to fix this issue.  Also, the barrier
does not need to be reinitialized as that is done by default.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 9874ca536b1d0662b1cea46af3ce09a4d42aeb32)

3 years agoUse $(pie-default) with conformtest
Joseph Myers [Fri, 17 Sep 2021 19:24:14 +0000 (19:24 +0000)] 
Use $(pie-default) with conformtest

My glibc bot showed that my conformtest changes fail the build of the
conformtest execution tests for x86_64-linux-gnu-static-pie, because
linking the newly built object with the newly built libc and the
associated options normally used for linking requires it to be built
as PIE.  Add $(pie-default) to the compiler command used so that PIE
options are used when required.

There's a case for using the whole of $(CFLAGS-.o) (which includes
$(pie-default)), but that raises questions of any impact from using
optimization flags from CFLAGS in these tests.  So for now just use
$(pie-default) as the key part of $(CFLAGS-.o) that's definitely
needed.

Tested with build-many-glibcs.py for x86_64-linux-gnu-static-pie.

(cherry picked from commit 885762aa31d75de8b9fea4c0e2e372b582d4c548)

3 years agoRun conform/ tests using newly built libc
Joseph Myers [Fri, 17 Sep 2021 13:12:10 +0000 (13:12 +0000)] 
Run conform/ tests using newly built libc

Although the conform/ header tests are built using the headers of the
glibc under test, the execution tests from conformtest (a few tests of
the values of macros evaluating to string constants) are linked and
run with system libc, not the newly built libc.

Apart from preventing testing in cross environments, this can be a
problem even for native testing.  Specifically, it can be useful to do
native testing when building with a cross compiler that links with a
libc that is not the system libc; for example, on x86_64, you can test
all three ABIs that way if the kernel support is present, even if the
host OS lacks 32-bit or x32 libraries or they are older than the
libraries in the sysroot used by the compiler used to build glibc.
This works for almost all tests, but not for these conformtest tests.

Arrange for conformtest to link and run test programs similarly to
other tests, with consequent refactoring of various variables in
Makeconfig to allow passing relevant parts of the link-time command
lines down to conformtest.  In general, the parts of the link command
involving $@ or $^ are separated out from the parts that should be
passed to conformtest (the variables passed to conformtest still
involve various variables whose names involve $(@F), but those
variables simply won't be defined for the conformtest makefile rules
and I think their presence there is harmless).

This is also most of the support that would be needed to allow running
those tests of string constants for cross testing when test-wrapper is
defined.  That will also need changes to where conformtest.py puts the
test executables, so it puts them in the main object directory
(expected to be shared with a test system in cross testing) rather
than /tmp (not expected to be shared) as at present.

Tested for x86_64.

(cherry picked from commit f3eef963902d0f54f68cffc74f79b97f4d6154b7)

3 years agonptl: Add one more barrier to nptl/tst-create1
Florian Weimer [Fri, 10 Dec 2021 04:14:24 +0000 (05:14 +0100)] 
nptl: Add one more barrier to nptl/tst-create1

Without the bar_ctor_finish barrier, it was possible that thread2
re-locked user_lock before ctor had a chance to lock it.  ctor then
blocked in its locking operation, xdlopen from the main thread
did not return, and thread2 was stuck waiting in bar_dtor:

thread 1: started.
thread 2: started.
thread 2: locked user_lock.
constructor started: 0.
thread 1: in ctor: started.
thread 3: started.
thread 3: done.
thread 2: unlocked user_lock.
thread 2: locked user_lock.

Fixes the test in commit 83b5323261bb72313bffcf37476c1b8f0847c736
("elf: Avoid deadlock between pthread_create and ctors [BZ #28357]").

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
(cherry picked from commit 5cc338565479a620244c2f8ff35956629c4dbf81)

3 years agopowerpc64[le]: Fix CFI and LR save address for asm syscalls [BZ #28532]
Matheus Castanho [Tue, 26 Oct 2021 13:44:59 +0000 (10:44 -0300)] 
powerpc64[le]: Fix CFI and LR save address for asm syscalls [BZ #28532]

Syscalls based on the assembly templates are missing CFI for r31, which gets
clobbered when scv is used, and info for LR is inaccurate, placed in the wrong
LOC and not using the proper offset. LR was also being saved to the callee's
frame, while the ABI mandates it to be saved to the caller's frame. These are
fixed by this commit.

After this change:

$ readelf -wF libc.so.6 | grep 0004b9d4.. -A 7 && objdump --disassemble=kill libc.so.6
00004a48 0000000000000020 00004a4c FDE cie=00000000 pc=000000000004b9d4..000000000004ba3c
   LOC           CFA      r31   ra
000000000004b9d4 r1+0     u     u
000000000004b9e4 r1+48    u     u
000000000004b9e8 r1+48    c-16  u
000000000004b9fc r1+48    c-16  c+16
000000000004ba08 r1+48    c-16
000000000004ba18 r1+48    u
000000000004ba1c r1+0     u

libc.so.6:     file format elf64-powerpcle

Disassembly of section .text:

000000000004b9d4 <kill>:
   4b9d4:       1f 00 4c 3c     addis   r2,r12,31
   4b9d8:       2c c3 42 38     addi    r2,r2,-15572
   4b9dc:       25 00 00 38     li      r0,37
   4b9e0:       d1 ff 21 f8     stdu    r1,-48(r1)
   4b9e4:       20 00 e1 fb     std     r31,32(r1)
   4b9e8:       98 8f ed eb     ld      r31,-28776(r13)
   4b9ec:       10 00 ff 77     andis.  r31,r31,16
   4b9f0:       1c 00 82 41     beq     4ba0c <kill+0x38>
   4b9f4:       a6 02 28 7d     mflr    r9
   4b9f8:       40 00 21 f9     std     r9,64(r1)
   4b9fc:       01 00 00 44     scv     0
   4ba00:       40 00 21 e9     ld      r9,64(r1)
   4ba04:       a6 03 28 7d     mtlr    r9
   4ba08:       08 00 00 48     b       4ba10 <kill+0x3c>
   4ba0c:       02 00 00 44     sc
   4ba10:       00 00 bf 2e     cmpdi   cr5,r31,0
   4ba14:       20 00 e1 eb     ld      r31,32(r1)
   4ba18:       30 00 21 38     addi    r1,r1,48
   4ba1c:       18 00 96 41     beq     cr5,4ba34 <kill+0x60>
   4ba20:       01 f0 20 39     li      r9,-4095
   4ba24:       40 48 23 7c     cmpld   r3,r9
   4ba28:       20 00 e0 4d     bltlr+
   4ba2c:       d0 00 63 7c     neg     r3,r3
   4ba30:       08 00 00 48     b       4ba38 <kill+0x64>
   4ba34:       20 00 e3 4c     bnslr+
   4ba38:       c8 32 fe 4b     b       2ed00 <__syscall_error>
        ...
   4ba44:       40 20 0c 00     .long 0xc2040
   4ba48:       68 00 00 00     .long 0x68
   4ba4c:       06 00 5f 5f     rlwnm   r31,r26,r0,0,3
   4ba50:       6b 69 6c 6c     xoris   r12,r3,26987

(cherry picked from commit d120fb9941be1fb1934f0b50c6ad64e4c5e404fb)

3 years agolinux: Use /proc/stat fallback for __get_nprocs_conf (BZ #28624)
Adhemerval Zanella [Thu, 25 Nov 2021 12:12:00 +0000 (09:12 -0300)] 
linux: Use /proc/stat fallback for __get_nprocs_conf (BZ #28624)

The /proc/statm fallback was removed by f13fb81ad3159 if sysfs is
not available, reinstate it.

Checked on x86_64-linux-gnu.
(cherry-picked from commit 137ed5ac440a4d3cf4178ce97f349b349a9c2c66)

3 years agonptl: Do not set signal mask on second setjmp return [BZ #28607]
Florian Weimer [Wed, 24 Nov 2021 07:59:54 +0000 (08:59 +0100)] 
nptl: Do not set signal mask on second setjmp return [BZ #28607]

__libc_signal_restore_set was in the wrong place: It also ran
when setjmp returned the second time (after pthread_exit or
pthread_cancel).  This is observable with blocked pending
signals during thread exit.

Fixes commit b3cae39dcbfa2432b3f3aa28854d8ac57f0de1b8
("nptl: Start new threads with all signals blocked [BZ #25098]").

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit e186fc5a31e46f2cbf5ea1a75223b4412907f3d8)

3 years agos390: Use long branches across object boundaries (jgh instead of jh)
Florian Weimer [Wed, 10 Nov 2021 14:21:37 +0000 (15:21 +0100)] 
s390: Use long branches across object boundaries (jgh instead of jh)

Depending on the layout chosen by the linker, the 16-bit displacement
of the jh instruction is insufficient to reach the target label.

Analysis of the linker failure was carried out by Nick Clifton.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Stefan Liebler <stli@linux.ibm.com>
(cherry picked from commit 98966749f2b418825ff2ea496a0ee89fe63d2cc8)

3 years agoelf: Earlier missing dynamic segment check in _dl_map_object_from_fd
Florian Weimer [Fri, 5 Nov 2021 16:01:24 +0000 (17:01 +0100)] 
elf: Earlier missing dynamic segment check in _dl_map_object_from_fd

Separated debuginfo files have PT_DYNAMIC with p_filesz == 0.  We
need to check for that before the _dl_map_segments call because
that could attempt to write to mappings that extend beyond the end
of the file, resulting in SIGBUS.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit ea32ec354c65ddad11b82ca9d057010df13a9cea)

3 years agogconv: Do not emit spurious NUL character in ISO-2022-JP-3 (bug 28524)
Nikita Popov [Tue, 2 Nov 2021 08:21:42 +0000 (13:21 +0500)] 
gconv: Do not emit spurious NUL character in ISO-2022-JP-3 (bug 28524)

Bugfix 27256 has introduced another issue:
In conversion from ISO-2022-JP-3 encoding, it is possible
to force iconv to emit extra NUL character on internal state reset.
To do this, it is sufficient to feed iconv with escape sequence
which switches active character set.
The simplified check 'data->__statep->__count != ASCII_set'
introduced by the aforementioned bugfix picks that case and
behaves as if '\0' character has been queued thus emitting it.

To eliminate this issue, these steps are taken:
* Restore original condition
'(data->__statep->__count & ~7) != ASCII_set'.
It is necessary since bits 0-2 may contain
number of buffered input characters.
* Check that queued character is not NUL.
Similar step is taken for main conversion loop.

Bundled test case follows following logic:
* Try to convert ISO-2022-JP-3 escape sequence
switching active character set
* Reset internal state by providing NULL as input buffer
* Ensure that nothing has been converted.

Signed-off-by: Nikita Popov <npv1310@gmail.com>
(cherry picked from commit ff012870b2c02a62598c04daa1e54632e020fd7d)

3 years agoAvoid warning: overriding recipe for .../tst-ro-dynamic-mod.so
H.J. Lu [Fri, 24 Sep 2021 15:56:42 +0000 (08:56 -0700)] 
Avoid warning: overriding recipe for .../tst-ro-dynamic-mod.so

Add tst-ro-dynamic-mod to modules-names-nobuild to avoid

../Makerules:767: warning: ignoring old recipe for target '.../elf/tst-ro-dynamic-mod.so'

This updates BZ #28340 fix.

(cherry picked from commit 15e6d6785ac2935bb963506b47a37b3d1f728952)

3 years agold.so: Initialize bootstrap_map.l_ld_readonly [BZ #28340]
H.J. Lu [Thu, 23 Sep 2021 16:06:49 +0000 (09:06 -0700)] 
ld.so: Initialize bootstrap_map.l_ld_readonly [BZ #28340]

1. Define DL_RO_DYN_SECTION to initalize bootstrap_map.l_ld_readonly
before calling elf_get_dynamic_info to get dynamic info in bootstrap_map,
2. Define a single

static inline bool
dl_relocate_ld (const struct link_map *l)
{
  /* Don't relocate dynamic section if it is readonly  */
  return !(l->l_ld_readonly || DL_RO_DYN_SECTION);
}

This updates BZ #28340 fix.

(cherry picked from commit 2ec99d8c42b2ff1a1231e4df462a0910a9b7fdef)

3 years agold.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340]
H.J. Lu [Thu, 16 Sep 2021 15:15:29 +0000 (08:15 -0700)] 
ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340]

We can't relocate entries in dynamic section if it is readonly:

1. Add a l_ld_readonly field to struct link_map to indicate if dynamic
section is readonly and set it based on p_flags of PT_DYNAMIC segment.
2. Replace DL_RO_DYN_SECTION with dl_relocate_ld to decide if dynamic
section should be relocated.
3. Remove DL_RO_DYN_TEMP_CNT.
4. Don't use a static dynamic section to make readonly dynamic section
in vDSO writable.
5. Remove the temp argument from elf_get_dynamic_info.

This fixes BZ #28340.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit b413280cfb16834450f66f554bc0d618bb513851)

3 years agoHandle NULL input to malloc_usable_size [BZ #28506]
Siddhesh Poyarekar [Fri, 29 Oct 2021 09:23:55 +0000 (14:53 +0530)] 
Handle NULL input to malloc_usable_size [BZ #28506]

Hoist the NULL check for malloc_usable_size into its entry points in
malloc-debug and malloc and assume non-NULL in all callees.  This fixes
BZ #28506

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
(cherry picked from commit 88e316b06414ee7c944cd6f8b30b07a972b78499)

3 years agoelf: Avoid deadlock between pthread_create and ctors [BZ #28357]
Szabolcs Nagy [Wed, 15 Sep 2021 14:16:19 +0000 (15:16 +0100)] 
elf: Avoid deadlock between pthread_create and ctors [BZ #28357]

The fix for bug 19329 caused a regression such that pthread_create can
deadlock when concurrent ctors from dlopen are waiting for it to finish.
Use a new GL(dl_load_tls_lock) in pthread_create that is not taken
around ctors in dlopen.

The new lock is also used in __tls_get_addr instead of GL(dl_load_lock).

The new lock is held in _dl_open_worker and _dl_close_worker around
most of the logic before/after the init/fini routines.  When init/fini
routines are running then TLS is in a consistent, usable state.
In _dl_open_worker the new lock requires catching and reraising dlopen
failures that happen in the critical section.

The new lock is reinitialized in a fork child, to keep the existing
behaviour and it is kept recursive in case malloc interposition or TLS
access from signal handlers can retake it.  It is not obvious if this
is necessary or helps, but avoids changing the preexisting behaviour.

The new lock may be more appropriate for dl_iterate_phdr too than
GL(dl_load_write_lock), since TLS state of an incompletely loaded
module may be accessed.  If the new lock can replace the old one,
that can be a separate change.

Fixes bug 28357.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 83b5323261bb72313bffcf37476c1b8f0847c736)

3 years agotimex: Use 64-bit fields on 32-bit TIMESIZE=64 systems (BZ #28469)
Stafford Horne [Thu, 14 Oct 2021 21:17:41 +0000 (06:17 +0900)] 
timex: Use 64-bit fields on 32-bit TIMESIZE=64 systems (BZ #28469)

This was found when testing the OpenRISC port I am working on.  These
two tests fail with SIGSEGV:

  FAIL: misc/tst-ntp_gettime
  FAIL: misc/tst-ntp_gettimex

This was found to be due to the kernel overwriting the stack space
allocated by the timex structure.  The reason for the overwrite being
that the kernel timex has 64-bit fields and user space code only
allocates enough stack space for timex with 32-bit fields.

On 32-bit systems with TIMESIZE=64 __USE_TIME_BITS64 is not defined.
This causes the timex structure to use 32-bit fields with type
__syscall_slong_t.

This patch adjusts the ifdef condition to allow 32-bit systems with
TIMESIZE=64 to use the 64-bit long long timex definition.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(Cherry picked from commit 1d550265a75b412cea4889a50b101395f6a8e025)

3 years agoy2038: Use a common definition for stat for sparc32
Adhemerval Zanella [Wed, 6 Oct 2021 11:10:13 +0000 (08:10 -0300)] 
y2038: Use a common definition for stat for sparc32

The sparc32 misses support for support done by 4e8521333bea6.

Checked on sparcv9-linux-gnu.

(cherry picked from commit d2b1254db208b35ff060f00a15f22a1eed5306d2)

3 years agoelf: Replace nsid with args.nsid [BZ #27609]
H.J. Lu [Thu, 30 Sep 2021 17:29:17 +0000 (10:29 -0700)] 
elf: Replace nsid with args.nsid [BZ #27609]

commit ec935dea6332cb22f9881cd1162bad156173f4b0
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Apr 24 22:31:15 2020 +0200

    elf: Implement __libc_early_init

has

@@ -856,6 +876,11 @@ no more namespaces available for dlmopen()"));
   /* See if an error occurred during loading.  */
   if (__glibc_unlikely (exception.errstring != NULL))
     {
+      /* Avoid keeping around a dangling reference to the libc.so link
+   map in case it has been cached in libc_map.  */
+      if (!args.libc_already_loaded)
+  GL(dl_ns)[nsid].libc_map = NULL;
+

do_dlopen calls _dl_open with nsid == __LM_ID_CALLER (-2), which calls
dl_open_worker with args.nsid = nsid.  dl_open_worker updates args.nsid
if it is __LM_ID_CALLER.  After dl_open_worker returns, it is wrong to
use nsid.

Replace nsid with args.nsid after dl_open_worker returns.  This fixes
BZ #27609.

(cherry picked from commit 1e1ecea62e899acb58c3fdf3b320a0833ddd0dff)

3 years agoS390: Add PCI_MIO and SIE HWCAPs
Stefan Liebler [Tue, 5 Oct 2021 14:14:10 +0000 (16:14 +0200)] 
S390: Add PCI_MIO and SIE HWCAPs

Both new HWCAPs were introduced in these kernel commits:
7e8403ecaf884f307b627f3c371475913dd29292
  "s390: add HWCAP_S390_PCI_MIO to ELF hwcaps"
7e82523f2583e9813e4109df3656707162541297
  "s390/hwcaps: make sie capability regular hwcap"

Also note that the kernel commit 511ad531afd4090625def4d9aba1f5227bd44b8e
"s390/hwcaps: shorten HWCAP defines" has shortened the prefix of the macros
from "HWCAP_S390_" to "HWCAP_".  For compatibility reasons, we do not
change the prefix in public glibc header file.

(cherry picked from commit f2e06656d04a9fcb0603802a4f8ce7aa3a1f055e)

3 years agosupport: Also return fd when it is 0
Siddhesh Poyarekar [Wed, 6 Oct 2021 16:18:35 +0000 (21:48 +0530)] 
support: Also return fd when it is 0

The fd validity check in open_dev_null checks if fd > 0, which would
lead to a leaked fd if it is == 0.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 27b6edbb090f736b101f569620d8ad0e7217ddf8)

3 years agoAdd missing braces to bsearch inline implementation [BZ #28400]
Florian Weimer [Thu, 30 Sep 2021 16:44:06 +0000 (18:44 +0200)] 
Add missing braces to bsearch inline implementation [BZ #28400]

GCC treats the pragma as a statement, so that the else branch only
consists of the pragma, not the return statement.

Fixes commit a725ff1de965f4cc4f36a7e8ae795d40ca0350d7 ("Suppress
-Wcast-qual warnings in bsearch").

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 32b96d0dec0294465d2221a8f049703599d9d8e4)

3 years agoSuppress -Wcast-qual warnings in bsearch
Jonathan Wakely [Wed, 19 May 2021 15:48:19 +0000 (16:48 +0100)] 
Suppress -Wcast-qual warnings in bsearch

The first cast to (void *) is redundant but should be (const void *)
anyway, because that's the type of the lvalue being assigned to.

The second cast is necessary and intentionally not const-correct, so
tell the compiler not to warn about it.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit a725ff1de965f4cc4f36a7e8ae795d40ca0350d7)

3 years agolinux: Revert the use of sched_getaffinity on get_nproc (BZ #28310)
Adhemerval Zanella [Mon, 6 Sep 2021 17:19:51 +0000 (14:19 -0300)] 
linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310)

The use of sched_getaffinity on get_nproc and
sysconf (_SC_NPROCESSORS_ONLN) done in 903bc7dcc2acafc40 (BZ #27645)
breaks the top command in common hypervisor configurations and also
other monitoring tools.

The main issue using sched_getaffinity changed the symbols semantic
from system-wide scope of online CPUs to per-process one (which can
be changed with kernel cpusets or book parameters in VM).

This patch reverts mostly of the 903bc7dcc2acafc40, with the
exceptions:

  * No more cached values and atomic updates, since they are inherent
    racy.

  * No /proc/cpuinfo fallback, since /proc/stat is already used and
    it would require to revert more arch-specific code.

  * The alloca is replace with a static buffer of 1024 bytes.

So the implementation first consult the sysfs, and fallbacks to procfs.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 342298278eabc75baabcaced110a11a02c3d3580)

3 years agolinux: Simplify get_nprocs
Adhemerval Zanella [Mon, 6 Sep 2021 15:28:24 +0000 (12:28 -0300)] 
linux: Simplify get_nprocs

This patch simplifies the memory allocation code and uses the sched
routines instead of reimplement it.  This still uses a stack
allocation buffer, so it can be used on malloc initialization code.

Linux currently supports at maximum of 4096 cpus for most architectures:

$ find -iname Kconfig | xargs git grep -A10 -w NR_CPUS | grep -w range
arch/alpha/Kconfig- range 2 32
arch/arc/Kconfig- range 2 4096
arch/arm/Kconfig- range 2 16 if DEBUG_KMAP_LOCAL
arch/arm/Kconfig- range 2 32 if !DEBUG_KMAP_LOCAL
arch/arm64/Kconfig- range 2 4096
arch/csky/Kconfig- range 2 32
arch/hexagon/Kconfig- range 2 6 if SMP
arch/ia64/Kconfig- range 2 4096
arch/mips/Kconfig- range 2 256
arch/openrisc/Kconfig- range 2 32
arch/parisc/Kconfig- range 2 32
arch/riscv/Kconfig- range 2 32
arch/s390/Kconfig- range 2 512
arch/sh/Kconfig- range 2 32
arch/sparc/Kconfig- range 2 32 if SPARC32
arch/sparc/Kconfig- range 2 4096 if SPARC64
arch/um/Kconfig- range 1 1
arch/x86/Kconfig-# [NR_CPUS_RANGE_BEGIN ... NR_CPUS_RANGE_END] range.
arch/x86/Kconfig- range NR_CPUS_RANGE_BEGIN NR_CPUS_RANGE_END
arch/xtensa/Kconfig- range 2 32

With x86 supporting 8192:

arch/x86/Kconfig
 976 config NR_CPUS_RANGE_END
 977         int
 978         depends on X86_64
 979         default 8192 if  SMP && CPUMASK_OFFSTACK
 980         default  512 if  SMP && !CPUMASK_OFFSTACK
 981         default    1 if !SMP

So using a maximum of 32k cpu should cover all cases (and I would
expect once we start to have many more CPUs that Linux would provide
a more straightforward way to query for such information).

A test is added to check if sched_getaffinity can successfully return
with large buffers.

Checked on x86_64-linux-gnu and i686-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 33099d72e41cf8a129b362e9709eb2be9372d844)

3 years agomisc: Add __get_nprocs_sched
Adhemerval Zanella [Mon, 6 Sep 2021 15:22:54 +0000 (12:22 -0300)] 
misc: Add __get_nprocs_sched

This is an internal function meant to return the number of avaliable
processor where the process can scheduled, different than the
__get_nprocs which returns a the system available online CPU.

The Linux implementation currently only calls __get_nprocs(), which
in tuns calls sched_getaffinity.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
(cherry picked from commit 11a02b035b464ab6813676adfd19c4a59c36d907)

3 years agonptl: pthread_kill must send signals to a specific thread [BZ #28407]
Florian Weimer [Fri, 1 Oct 2021 16:16:41 +0000 (18:16 +0200)] 
nptl: pthread_kill must send signals to a specific thread [BZ #28407]

The choice between the kill vs tgkill system calls is not just about
the TID reuse race, but also about whether the signal is sent to the
whole process (and any thread in it) or to a specific thread.

This was caught by the openposix test suite:

  LTP: openposix test suite - FAIL: SIGUSR1 is member of new thread pendingset.
  <https://gitlab.com/cki-project/kernel-tests/-/issues/764>

Fixes commit 526c3cf11ee9367344b6b15d669e4c3cb461a2be ("nptl: Fix race
between pthread_kill and thread exit (bug 12889)").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit eae81d70574e923ce3c59078b8df857ae192efa6)

3 years agosupport: Add check for TID zero in support_wait_for_thread_exit
Florian Weimer [Fri, 1 Oct 2021 16:16:41 +0000 (18:16 +0200)] 
support: Add check for TID zero in support_wait_for_thread_exit

Some kernel versions (observed with kernel 5.14 and earlier) can list
"0" entries in /proc/self/task.  This happens when a thread exits
while the task list is being constructed.  Treat this entry as not
present, like the proposed kernel patch does:

[PATCH] procfs: Do not list TID 0 in /proc/<pid>/task
<https://lore.kernel.org/all/8735pn5dx7.fsf@oldenburg.str.redhat.com/>

Fixes commit 032d74eaf6179100048a5bf0ce942e97dc8b9a60 ("support: Add
support_wait_for_thread_exit").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 176c88f5214d8107d330971cbbfbbba5186a111f)

3 years agonptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361]
Florian Weimer [Thu, 23 Sep 2021 07:55:54 +0000 (09:55 +0200)] 
nptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361]

As part of the fix for bug 12889, signals are blocked during
thread exit, so that application code cannot run on the thread that
is about to exit.  This would cause problems if the application
expected signals to be delivered after the signal handler revealed
the thread to still exist, despite pthread_kill can no longer be used
to send signals to it.  However, glibc internally uses the SIGSETXID
signal in a way that is incompatible with signal blocking, due to the
way the setxid handshake delays thread exit until the setxid operation
has completed.  With a blocked SIGSETXID, the handshake can never
complete, causing a deadlock.

As a band-aid, restore the previous handshake protocol by not blocking
SIGSETXID during thread exit.

The new test sysdeps/pthread/tst-pthread-setuid-loop.c is based on
a downstream test by Martin Osvald.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 2849e2f53311b66853cb5159b64cba2bddbfb854)

3 years agoUse support_open_dev_null_range io/tst-closefrom, misc/tst-close_range, and posix...
Adhemerval Zanella [Tue, 24 Aug 2021 19:15:50 +0000 (16:15 -0300)] 
Use support_open_dev_null_range io/tst-closefrom, misc/tst-close_range, and posix/tst-spawn5 (BZ #28260)

It ensures a continuous range of file descriptor and avoid hitting
the RLIMIT_NOFILE.

Checked on x86_64-linux-gnu.

(cherry picked from commit 6b20880b22d1d0fce7e9f506baa6fe2d5c7fcfdc)

3 years agosupport: Add support_open_dev_null_range
Adhemerval Zanella [Tue, 24 Aug 2021 19:12:24 +0000 (16:12 -0300)] 
support: Add support_open_dev_null_range

It returns a range of file descriptor referring to the '/dev/null'
pathname.  The function takes care of restarting the open range
if a file descriptor is found within the specified range and
also increases RLIMIT_NOFILE if required.

Checked on x86_64-linux-gnu.

(cherry picked from commit e814f4b04ee413a7bb3dfa43e74c8fb4abf58359)

3 years agonptl: Fix type of pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust_np...
Florian Weimer [Tue, 21 Sep 2021 05:12:56 +0000 (07:12 +0200)] 
nptl: Fix type of pthread_mutexattr_getrobust_np, pthread_mutexattr_setrobust_np (bug 28036)

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit f3e664563361dc17530113b3205998d1f19dc4d9)

3 years agonptl: pthread_kill needs to return ESRCH for old programs (bug 19193)
Florian Weimer [Mon, 20 Sep 2021 12:56:08 +0000 (14:56 +0200)] 
nptl: pthread_kill needs to return ESRCH for old programs (bug 19193)

The fix for bug 19193 breaks some old applications which appear
to use pthread_kill to probe if a thread is still running, something
that is not supported by POSIX.

(cherry picked from commit 95dba35bf05e4a5d69dfae5e9c9d4df3646a7f93)

3 years agoposix: Fix attribute access mode on getcwd [BZ #27476]
Aurelien Jarno [Fri, 10 Sep 2021 17:39:35 +0000 (19:39 +0200)] 
posix: Fix attribute access mode on getcwd [BZ #27476]

There is a GNU extension that allows to call getcwd(NULL, >0). It is
described in the documentation, but also directly in the unistd.h
header, just above the declaration.

Therefore the attribute access mode added in commit 06febd8c6705
is not correct. Drop it.

3 years agoAdd MADV_POPULATE_READ and MADV_POPULATE_WRITE from Linux 5.14 to bits/mman-linux.h
Joseph Myers [Tue, 14 Sep 2021 14:19:24 +0000 (14:19 +0000)] 
Add MADV_POPULATE_READ and MADV_POPULATE_WRITE from Linux 5.14 to bits/mman-linux.h

Linux 5.14 adds constants MADV_POPULATE_READ and MADV_POPULATE_WRITE
(with the same values on all architectures).  Add these to glibc's
bits/mman-linux.h.

Tested for x86_64.

(cherry picked from commit 3561106278cddd2f007bd27fd4c3e90caaf14b43)

3 years agoUpdate kernel version to 5.14 in tst-mman-consts.py
Joseph Myers [Tue, 14 Sep 2021 13:51:58 +0000 (13:51 +0000)] 
Update kernel version to 5.14 in tst-mman-consts.py

This patch updates the kernel version in the test tst-mman-consts.py
to 5.14.  (There are no new MAP_* constants covered by this test in
5.14 that need any other header changes.)

Tested with build-many-glibcs.py.

(cherry picked from commit 4b39e3498324d1aea802fea8d4b8764f5ddb4fd1)

3 years agoUpdate syscall lists for Linux 5.14
Joseph Myers [Wed, 8 Sep 2021 12:42:06 +0000 (12:42 +0000)] 
Update syscall lists for Linux 5.14

Linux 5.14 has two new syscalls, memfd_secret (on some architectures
only) and quotactl_fd.  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 89dc0372a9055e7ef86fe19be6201fa0b16b2f0e)

3 years agoUse Linux 5.14 in build-many-glibcs.py
Joseph Myers [Tue, 7 Sep 2021 13:08:38 +0000 (13:08 +0000)] 
Use Linux 5.14 in build-many-glibcs.py

This patch makes build-many-glibcs.py use Linux 5.14.

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).

(cherry picked from commit 4e04a47208e1712fcf202a6d9831f0900d575225)

3 years agoFix failing nss/tst-nss-files-hosts-long with local resolver
Aurelien Jarno [Thu, 2 Sep 2021 22:28:14 +0000 (00:28 +0200)] 
Fix failing nss/tst-nss-files-hosts-long with local resolver

When a local resolver like unbound is listening on the IPv4 loopback
address 127.0.0.1, the nss/tst-nss-files-hosts-long test fails. This is
due to:
- the default resolver in the absence of resolv.conf being 127.0.0.1
- the default DNS NSS database configuration in the absence of
  nsswitch.conf being 'hosts: dns [!UNAVAIL=return] file'

This causes the requests for 'test4' and 'test6' to first be sent to the
local resolver, which responds with NXDOMAIN in the likely case those
records do no exist. In turn that causes the access to /etc/hosts to be
skipped, which is the purpose of that test.

Fix that by providing a simple nsswitch.conf file forcing access to
/etc/hosts for that test. I have tested that the only changed result in
the testsuite is that test.

(cherry picked from commit 2738480a4b0866723fb8c633f36bdd34a8767581)

3 years agoiconvconfig: Fix behaviour with --prefix [BZ #28199]
Siddhesh Poyarekar [Mon, 13 Sep 2021 15:18:35 +0000 (20:48 +0530)] 
iconvconfig: Fix behaviour with --prefix [BZ #28199]

The consolidation of configuration parsing broke behaviour with
--prefix, where the prefix bled into the modules cache.  Accept a
prefix which, when non-NULL, is prepended to the path when looking for
configuration files but only the original directory is added to the
modules cache.

This has no effect on the codegen of gconv_conf since it passes NULL.

Reported-by: Patrick McCarty <patrick.mccarty@intel.com>
Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Andreas Schwab <schwab@linux-m68k.org>
(cherry picked from commit 43cea6d5652b6b9e61ac6ecc69419c909b504f47)

3 years agonptl: Fix race between pthread_kill and thread exit (bug 12889)
Florian Weimer [Mon, 13 Sep 2021 09:06:08 +0000 (11:06 +0200)] 
nptl: Fix race between pthread_kill and thread exit (bug 12889)

A new thread exit lock and flag are introduced.  They are used to
detect that the thread is about to exit or has exited in
__pthread_kill_internal, and the signal is not sent in this case.

The test sysdeps/pthread/tst-pthread_cancel-select-loop.c is derived
from a downstream test originally written by Marek Polacek.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 526c3cf11ee9367344b6b15d669e4c3cb461a2be)

3 years agonptl: pthread_kill, pthread_cancel should not fail after exit (bug 19193)
Florian Weimer [Mon, 13 Sep 2021 09:06:08 +0000 (11:06 +0200)] 
nptl: pthread_kill, pthread_cancel should not fail after exit (bug 19193)

This closes one remaining race condition related to bug 12889: if
the thread already exited on the kernel side, returning ESRCH
is not correct because that error is reserved for the thread IDs
(pthread_t values) whose lifetime has ended.  In case of a
kernel-side exit and a valid thread ID, no signal needs to be sent
and cancellation does not have an effect, so just return 0.

sysdeps/pthread/tst-kill4.c triggers undefined behavior and is
removed with this commit.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 8af8456004edbab71f8903a60a3cae442cf6fe69)

3 years agosupport: Add support_wait_for_thread_exit
Florian Weimer [Mon, 30 Aug 2021 11:43:56 +0000 (13:43 +0200)] 
support: Add support_wait_for_thread_exit

(cherry picked from commit 032d74eaf6179100048a5bf0ce942e97dc8b9a60)

3 years agoMIPS: Setup errno for {f,l,}xstat
Jiaxun Yang [Tue, 7 Sep 2021 05:31:42 +0000 (13:31 +0800)] 
MIPS: Setup errno for {f,l,}xstat

{f,l,}xstat stub for MIPS is using INTERNAL_SYSCALL
to do xstat syscall for glibc ver, However it leaves
errno untouched and thus giving bad errno output.

Setup errno properly when syscall returns non-zero.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit 66016ec8aeefd40e016d7040d966484c764b0e9c)

3 years agox86-64: Use testl to check __x86_string_control
H.J. Lu [Sat, 28 Aug 2021 13:10:38 +0000 (06:10 -0700)] 
x86-64: Use testl to check __x86_string_control

Use testl, instead of andl, to check __x86_string_control to avoid
updating __x86_string_control.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit 3c8b9879cab6d41787bc5b14c1748f62fd6d0e5f)

3 years agoelf: Fix missing colon in LD_SHOW_AUXV output [BZ #28253]
Arjun Shankar [Fri, 20 Aug 2021 14:24:05 +0000 (16:24 +0200)] 
elf: Fix missing colon in LD_SHOW_AUXV output [BZ #28253]

This commit adds a missing colon in the AT_MINSIGSTKSZ entry in
the _dl_show_auxv function.

(cherry picked from commit 82fbcd7118d760492e2ecc9fa291e358b9ba0361)

3 years agolibrt: add test (bug 28213)
Nikita Popov [Thu, 12 Aug 2021 10:39:50 +0000 (16:09 +0530)] 
librt: add test (bug 28213)

This test implements following logic:
1) Create POSIX message queue.
   Register a notification with mq_notify (using NULL attributes).
   Then immediately unregister the notification with mq_notify.
   Helper thread in a vulnerable version of glibc
   should cause NULL pointer dereference after these steps.
2) Once again, register the same notification.
   Try to send a dummy message.
   Test is considered successfulif the dummy message
   is successfully received by the callback function.

Signed-off-by: Nikita Popov <npv1310@gmail.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit 4cc79c217744743077bf7a0ec5e0a4318f1e6641)

3 years agolibrt: fix NULL pointer dereference (bug 28213)
Nikita Popov [Mon, 9 Aug 2021 14:47:34 +0000 (20:17 +0530)] 
librt: fix NULL pointer dereference (bug 28213)

Helper thread frees copied attribute on NOTIFY_REMOVED message
received from the OS kernel.  Unfortunately, it fails to check whether
copied attribute actually exists (data.attr != NULL).  This worked
earlier because free() checks passed pointer before actually
attempting to release corresponding memory.  But
__pthread_attr_destroy assumes pointer is not NULL.

So passing NULL pointer to __pthread_attr_destroy will result in
segmentation fault.  This scenario is possible if
notification->sigev_notify_attributes == NULL (which means default
thread attributes should be used).

Signed-off-by: Nikita Popov <npv1310@gmail.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
(cherry picked from commit b805aebd42364fe696e417808a700fdb9800c9e8)

3 years agoLinux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)
Florian Weimer [Fri, 6 Aug 2021 07:51:38 +0000 (09:51 +0200)] 
Linux: Fix fcntl, ioctl, prctl redirects for _TIME_BITS=64 (bug 28182)

__REDIRECT and __THROW are not compatible with C++ due to the ordering of the
__asm__ alias and the throw specifier. __REDIRECT_NTH has to be used
instead.

Fixes commit 8a40aff86ba5f64a3a84883e539cb67b ("io: Add time64 alias
for fcntl"), commit 82c395d91ea4f69120d453aeec398e30 ("misc: Add
time64 alias for ioctl"), commit b39ffab860cd743a82c91946619f1b8158
("Linux: Add time64 alias for prctl").

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit c87fcacc50505d550f1bb038382bcc7ea73a5926)

4 years agoiconv_charmap: Close output file when done
Siddhesh Poyarekar [Tue, 3 Aug 2021 15:40:29 +0000 (21:10 +0530)] 
iconv_charmap: Close output file when done

Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 1e0e6d656db9dfa12ef7eb67976385d3deb0d4ff)

4 years agocopy_and_spawn_sgid: Avoid double calls to close()
Siddhesh Poyarekar [Tue, 3 Aug 2021 15:40:53 +0000 (21:10 +0530)] 
copy_and_spawn_sgid: Avoid double calls to close()

If close() on infd and outfd succeeded, reset the fd numbers so that
we don't attempt to close them again.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 45caed9d67a00af917d8b5b88d4b5eb1225b7aef)

4 years agogaiconf_init: Avoid double-free in label and precedence lists
Siddhesh Poyarekar [Tue, 3 Aug 2021 15:41:03 +0000 (21:11 +0530)] 
gaiconf_init: Avoid double-free in label and precedence lists

labellist and precedencelist could get freed a second time if there
are allocation failures, so set them to NULL to avoid a double-free.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 77a34079d8f3d63b61543bf3af93043f8674e4c4)

4 years agogconv_parseconfdir: Fix memory leak
Siddhesh Poyarekar [Tue, 3 Aug 2021 15:40:20 +0000 (21:10 +0530)] 
gconv_parseconfdir: Fix memory leak

The allocated `conf` would leak if we have to skip over the file due
to the underlying filesystem not supporting dt_type.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit 5f9b78fe35d08739b6da1e5b356786d41116c108)

4 years agoldconfig: avoid leak on empty paths in config file
Siddhesh Poyarekar [Tue, 3 Aug 2021 15:40:10 +0000 (21:10 +0530)] 
ldconfig: avoid leak on empty paths in config file

Reviewed-by: Arjun Shankar <arjun@redhat.com>
(cherry picked from commit b0234d79e7d82475d1666f25326ec045c045b3ed)

4 years agoUpdate ChangeLog.old/ChangeLog.23. glibc-2.34
Carlos O'Donell [Mon, 2 Aug 2021 01:33:43 +0000 (21:33 -0400)] 
Update ChangeLog.old/ChangeLog.23.

4 years agoPrepare for glibc 2.34 release.
Carlos O'Donell [Mon, 2 Aug 2021 01:24:04 +0000 (21:24 -0400)] 
Prepare for glibc 2.34 release.

Update version.h, and include/features.h.

4 years agopo/nl.po: Update Dutch translation.
Carlos O'Donell [Mon, 2 Aug 2021 00:47:29 +0000 (20:47 -0400)] 
po/nl.po: Update Dutch translation.

4 years agoUpdate install.texi, and regenerate INSTALL.
Carlos O'Donell [Sun, 1 Aug 2021 20:36:25 +0000 (16:36 -0400)] 
Update install.texi, and regenerate INSTALL.

4 years agoUpdate translations.
Carlos O'Donell [Sun, 1 Aug 2021 03:24:51 +0000 (23:24 -0400)] 
Update translations.

4 years agoUpdate NEWS.
Carlos O'Donell [Sun, 1 Aug 2021 03:39:07 +0000 (23:39 -0400)] 
Update NEWS.

Suggestions by Florian Weimer, Andreas Schwab, and Alexander Monakov.

See:
https://sourceware.org/pipermail/libc-alpha/2021-July/129356.html
https://sourceware.org/pipermail/libc-alpha/2021-July/129357.html
https://sourceware.org/pipermail/libc-alpha/2021-July/129361.html

4 years agoNEWS: Fix typos, grammar, and missing words
Mark Harris [Sat, 31 Jul 2021 23:25:57 +0000 (16:25 -0700)] 
NEWS: Fix typos, grammar, and missing words

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 years agoelf: Fix audit regression
Adhemerval Zanella [Wed, 30 Jun 2021 03:21:18 +0000 (00:21 -0300)] 
elf: Fix audit regression

Commit 03e187a41d9 added a regression when an audit module does not have
libc as DT_NEEDED (although unusual it is possible).

Checked on x86_64-linux-gnu.

4 years agoUpdate libc.pot for 2.34 release.
Carlos O'Donell [Thu, 29 Jul 2021 02:03:54 +0000 (22:03 -0400)] 
Update libc.pot for 2.34 release.

4 years agox86-64: Add Avoid_Short_Distance_REP_MOVSB
H.J. Lu [Fri, 23 Jul 2021 03:26:25 +0000 (20:26 -0700)] 
x86-64: Add Avoid_Short_Distance_REP_MOVSB

commit 3ec5d83d2a237d39e7fd6ef7a0bc8ac4c171a4a5
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Jan 25 14:19:40 2020 -0800

    x86-64: Avoid rep movsb with short distance [BZ #27130]

introduced some regressions on Intel processors without Fast Short REP
MOV (FSRM).  Add Avoid_Short_Distance_REP_MOVSB to avoid rep movsb with
short distance only on Intel processors with FSRM.  bench-memmove-large
on Skylake server shows that cycles of __memmove_evex_unaligned_erms
improves for the following data size:

                                  before    after    Improvement
length=4127, align1=3, align2=0:  479.38    349.25      27%
length=4223, align1=9, align2=5:  405.62    333.25      18%
length=8223, align1=3, align2=0:  786.12    496.38      37%
length=8319, align1=9, align2=5:  727.50    501.38      31%
length=16415, align1=3, align2=0: 1436.88   840.00      41%
length=16511, align1=9, align2=5: 1375.50   836.38      39%
length=32799, align1=3, align2=0: 2890.00   1860.12     36%
length=32895, align1=9, align2=5: 2891.38   1931.88     33%

4 years agoTypo: Rename HAVE_CLONE3_WAPPER to HAVE_CLONE3_WRAPPER
H.J. Lu [Wed, 28 Jul 2021 17:19:08 +0000 (10:19 -0700)] 
Typo: Rename HAVE_CLONE3_WAPPER to HAVE_CLONE3_WRAPPER

4 years agobuild-many-glibcs.py: Add x86_64-linux-gnu-minimal configuration
Florian Weimer [Wed, 28 Jul 2021 12:47:33 +0000 (14:47 +0200)] 
build-many-glibcs.py: Add x86_64-linux-gnu-minimal configuration

This configuration exercises various --disable-* configure options.
It is expected to catch -Werror failures that only affect these
configurations.

4 years agotests: use xmalloc to allocate implementation array
Siddhesh Poyarekar [Wed, 28 Jul 2021 07:33:27 +0000 (13:03 +0530)] 
tests: use xmalloc to allocate implementation array

The benchmark and tests must fail in case of allocation failure in the
implementation array.  Also annotate the x* allocators in support.h so
that the compiler has more information about them.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 years agoxmalloc: Fix warnings with gcc analyzer
Siddhesh Poyarekar [Wed, 28 Jul 2021 11:28:17 +0000 (16:58 +0530)] 
xmalloc: Fix warnings with gcc analyzer

Tell the compiler that xmalloc family of allocators always return
non-NULL.  xrealloc in locale/programs also always returns non-NULL,
but that conflicts with default realloc behaviour and that of xrealloc
in libsupport, so keep it as is for now and resolve the differences
later.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 years ago__cxa_thread_atexit_impl: Abort on allocation failure [BZ #18524]
Siddhesh Poyarekar [Wed, 28 Jul 2021 07:41:20 +0000 (13:11 +0530)] 
__cxa_thread_atexit_impl: Abort on allocation failure [BZ #18524]

Abort in the unlikely event that allocation fails when trying to
register a TLS destructor.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 years agomanual: Drop the .so suffix in libc_malloc_debug description
Siddhesh Poyarekar [Tue, 27 Jul 2021 02:24:46 +0000 (07:54 +0530)] 
manual: Drop the .so suffix in libc_malloc_debug description

All references to libraries in the manual are without the .so prefix,
so do the same for libc_malloc_debug.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 years agohurd: _Fork: unlock malloc before calling fork child hooks
Samuel Thibault [Tue, 27 Jul 2021 00:03:01 +0000 (02:03 +0200)] 
hurd: _Fork: unlock malloc before calling fork child hooks

The setitimer fork hook, fork_itimer, needs to call malloc inside
__mach_setup_tls, so we need to unlock malloc before calling it.