platform/upstream/glibc.git
3 years agoUpdate syscall lists for Linux 5.12.
Joseph Myers [Wed, 28 Apr 2021 17:19:24 +0000 (17:19 +0000)]
Update syscall lists for Linux 5.12.

Linux 5.12 has one new syscall, mount_setattr.  Update
syscall-names.list and regenerate the arch-syscall.h headers with
build-many-glibcs.py update-syscalls.

Tested with build-many-glibcs.py.

3 years agoregenerate ulps on x86_64 with -march=native
Paul Zimmermann [Wed, 28 Apr 2021 09:02:00 +0000 (11:02 +0200)]
regenerate ulps on x86_64 with -march=native

On x86_64, when configuring glibc with CFLAGS="-O2 -g -march=native",
some tests fail. After this patch, "make check" succeeds.

Tested on Intel Core i5-4590 with gcc 10.2.1.

3 years agoPass a valid pointer to pthread_setspecific to avoid GCC 11 warning.
Martin Sebor [Wed, 28 Apr 2021 01:05:30 +0000 (19:05 -0600)]
Pass a valid pointer to pthread_setspecific to avoid GCC 11 warning.

3 years agoAdd __attribute_access_none to disable GCC warnings [BZ #27714]
Martin Sebor [Tue, 27 Apr 2021 19:01:55 +0000 (13:01 -0600)]
Add __attribute_access_none to disable GCC warnings [BZ #27714]

GCC 11 warns when a pointer to an uninitialized object is passed
to a function that takes a const-qualified argument.  This is done
on the assumption that most such functions read from the object.
For the rare case of a function that doesn't, GCC 11 extends
attribute access to add a new mode called none.

POSIX pthread_setspecific() is one such rare function that takes
a const void* argument but that doesn't read from the object it
points to.  To suppress the -Wmaybe-uninitialized issued by GCC
11 when the address of an uninitialized object is passed to it
(e.g., the result of malloc()), this change #defines
__attr_access_none in cdefs.h and uses the macro on the function
in sysdeps/htl/pthread.h and sysdeps/nptl/pthread.h.

3 years agoUse Linux 5.12 and GCC 11 branch in build-many-glibcs.py.
Joseph Myers [Tue, 27 Apr 2021 15:19:08 +0000 (15:19 +0000)]
Use Linux 5.12 and GCC 11 branch in build-many-glibcs.py.

This patch makes build-many-glibcs.py use Linux 5.12 and GCC 11
branch.

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

3 years agopowerpc: Add log IFUNC multiarch support for POWER10
Raphael Moreira Zinsly [Thu, 25 Feb 2021 13:42:27 +0000 (10:42 -0300)]
powerpc: Add log IFUNC multiarch support for POWER10

Checked on ppc64le built without --with-cpu, with --with-cpu=power9
and with --disable-multi-arch.

Reviewed-by: Matheus Castanho <msc@linux.ibm.com>
3 years agoLC_COLLATE: Fix last character ellipsis handling (Bug 22668)
Hanataka Shinya [Thu, 18 Feb 2021 04:00:48 +0000 (23:00 -0500)]
LC_COLLATE: Fix last character ellipsis handling (Bug 22668)

During ellipsis processing the collation cursor was not correctly
moved to the end of the ellipsis after processing.

The code inserted the new entry after the cursor, but before the
real end of the ellipsis:
                                [cursor]
... element_t <-> element_t <-> element_t <-> element_t
                  "<U0000>"     "<U0001>"     "<U007F>"
                  startp                      endp

At the end of the function we have:

                  [cursor]
... element_t <-> element_t <-> element_t
                  "<U007E>"     "<U007F>"
                                endp

The cursor should be pointing at endp, the last element in the
doubly-linked list, otherwise when execution returns to the
caller we will start inserting the next line after <U007E>.

Subsequent operations end up unlinking the ellipsis end entry or
just leaving it in the list dangling from the end.  This kind of
dangling is immediately visible in C.UTF-8 with the following
sorting from strcoll:
<U0010FFFF>
<U0000FFFF>
<U000007FF>
<U0000007F>

With the cursor correctly adjusted the end entry is correctly given
the right location and thus the right weight.

Retested and no regressions on x86_64 and i686.

Co-authored-by: Carlos O'Donell <carlos@redhat.com>
3 years agox86: Optimize strchr-evex.S
Noah Goldstein [Fri, 23 Apr 2021 19:56:25 +0000 (15:56 -0400)]
x86: Optimize strchr-evex.S

No bug. This commit optimizes strchr-evex.S. The optimizations are
mostly small things such as save an ALU in the alignment process,
saving a few instructions in the loop return. The one significant
change is saving 2 instructions in the 4x loop. test-strchr,
test-strchrnul, test-wcschr, and test-wcschrnul are all passing.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agox86: Optimize strchr-avx2.S
Noah Goldstein [Fri, 23 Apr 2021 19:56:24 +0000 (15:56 -0400)]
x86: Optimize strchr-avx2.S

No bug. This commit optimizes strchr-avx2.S. The optimizations are all
small things such as save an ALU in the alignment process, saving a
few instructions in the loop return, saving some bytes in the main
loop, and increasing the ILP in the return cases. test-strchr,
test-strchrnul, test-wcschr, and test-wcschrnul are all passing.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agonptl: Remove __h_errno_location from libpthread
Florian Weimer [Fri, 23 Apr 2021 16:08:38 +0000 (18:08 +0200)]
nptl: Remove __h_errno_location from libpthread

The existing definition in libc will be used instead.

The symbol was moved (that is, removed) using
scripts/move-symbol-to-libc.py.

3 years agonptl: Remove __res_state from libpthread
Florian Weimer [Fri, 23 Apr 2021 16:08:37 +0000 (18:08 +0200)]
nptl: Remove __res_state from libpthread

The existing definition in libc will be used instead.

The symbol was moved (that is, removed) using
scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_spin_trylock into libc
Florian Weimer [Fri, 23 Apr 2021 08:23:24 +0000 (10:23 +0200)]
nptl: Move pthread_spin_trylock into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_spin_lock into libc
Florian Weimer [Fri, 23 Apr 2021 08:11:51 +0000 (10:11 +0200)]
nptl: Move pthread_spin_lock into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_spin_init, Move pthread_spin_unlock into libc
Florian Weimer [Thu, 22 Apr 2021 13:18:12 +0000 (15:18 +0200)]
nptl: Move pthread_spin_init, Move pthread_spin_unlock  into libc

For some architectures, the two functions are aliased, so these
symbols need to be moved at the same time.

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_spin_destroy into libc
Florian Weimer [Thu, 22 Apr 2021 13:12:09 +0000 (15:12 +0200)]
nptl: Move pthread_spin_destroy into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_condattr_setpshared into libc
Florian Weimer [Fri, 23 Apr 2021 09:17:10 +0000 (11:17 +0200)]
nptl: Move pthread_condattr_setpshared into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_condattr_setclock into libc
Florian Weimer [Fri, 23 Apr 2021 09:02:54 +0000 (11:02 +0200)]
nptl: Move pthread_condattr_setclock into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_condattr_getpshared into libc
Florian Weimer [Fri, 23 Apr 2021 09:00:53 +0000 (11:00 +0200)]
nptl: Move pthread_condattr_getpshared into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_condattr_getclock into libc
Florian Weimer [Fri, 23 Apr 2021 08:55:07 +0000 (10:55 +0200)]
nptl: Move pthread_condattr_getclock into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_settype, __pthread_mutexattr_settype into libc
Florian Weimer [Fri, 23 Apr 2021 07:49:00 +0000 (09:49 +0200)]
nptl: Move pthread_mutexattr_settype, __pthread_mutexattr_settype into libc

And pthread_mutexattr_setkind_np as a compatibility symbol.

__pthread_mutexattr_settype is used in mtx_init from libpthread,
so this commit adds a GLIBC_2.34 symbol version for it.

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_setrobust into libc
Florian Weimer [Fri, 23 Apr 2021 07:48:36 +0000 (09:48 +0200)]
nptl: Move pthread_mutexattr_setrobust into libc

And pthread_mutexattr_getrobust_np as a compat symbol.

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agopthread: Use pthread_mutexattr_setrobust in tests
Florian Weimer [Fri, 23 Apr 2021 07:48:10 +0000 (09:48 +0200)]
pthread: Use pthread_mutexattr_setrobust in tests

pthread_mutexattr_setrobust_np is about to be deprecated.

3 years agonptl: Move pthread_mutexattr_setpshared into libc
Florian Weimer [Fri, 23 Apr 2021 07:48:09 +0000 (09:48 +0200)]
nptl: Move pthread_mutexattr_setpshared into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_setprotocol into libc
Florian Weimer [Fri, 23 Apr 2021 07:47:37 +0000 (09:47 +0200)]
nptl: Move pthread_mutexattr_setprotocol into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_setprioceiling into libc
Florian Weimer [Fri, 23 Apr 2021 07:47:15 +0000 (09:47 +0200)]
nptl: Move pthread_mutexattr_setprioceiling into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_init, __pthread_mutexattr_init into libc
Florian Weimer [Fri, 23 Apr 2021 07:46:57 +0000 (09:46 +0200)]
nptl: Move pthread_mutexattr_init, __pthread_mutexattr_init into libc

__pthread_mutexattr_init cannot be be made a compat symbol because
it is used in mtx_init, which is still in libpthread.

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_gettype into libc
Florian Weimer [Fri, 23 Apr 2021 07:46:15 +0000 (09:46 +0200)]
nptl: Move pthread_mutexattr_gettype into libc

And pthread_mutexattr_getkind_np as a compatibility symbol.
(There is no declaration in <pthread.h>, so there is no need
to add an alias or a deprecation warning there.)

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_getrobust into libc
Florian Weimer [Fri, 23 Apr 2021 07:46:03 +0000 (09:46 +0200)]
nptl: Move pthread_mutexattr_getrobust into libc

And pthread_mutexattr_getrobust_np as a compat symbol.

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_getpshared into libc
Florian Weimer [Fri, 23 Apr 2021 07:45:48 +0000 (09:45 +0200)]
nptl: Move pthread_mutexattr_getpshared into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_getprotocol into libc
Florian Weimer [Fri, 23 Apr 2021 07:45:29 +0000 (09:45 +0200)]
nptl: Move pthread_mutexattr_getprotocol into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_getprioceiling into libc
Florian Weimer [Fri, 23 Apr 2021 07:45:09 +0000 (09:45 +0200)]
nptl: Move pthread_mutexattr_getprioceiling into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutexattr_destroy into libc
Florian Weimer [Fri, 23 Apr 2021 07:44:49 +0000 (09:44 +0200)]
nptl: Move pthread_mutexattr_destroy into libc

And __pthread_mutexattr_destroy as a compat symbol (so no
GLIBC_2.34 symbol version is added for it).

The symbols were moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutex_trylock, __pthread_mutex_trylock into libc
Florian Weimer [Fri, 23 Apr 2021 07:44:23 +0000 (09:44 +0200)]
nptl: Move pthread_mutex_trylock, __pthread_mutex_trylock into libc

The symbols were moved using scripts/move-symbol-to-libc.py.

__pthread_mutex_trylock is used to implement mtx_timedlock,
which still resides in libpthread, so add a GLIBC_2.34 version
for it, to match the existing GLIBC_2.0 version.

3 years agonptl: Move pthread_mutex_timedlock, pthread_mutex_clocklock to libc
Florian Weimer [Fri, 23 Apr 2021 07:43:24 +0000 (09:43 +0200)]
nptl: Move pthread_mutex_timedlock, pthread_mutex_clocklock to libc

The symbols were moved using scripts/move-symbol-to-libc.py.
The symbol aliasing follows pthread_cond_timedwait et al.
Missing hidden prototypes had to be added to nptl/pthreadP.h
for consistency.

3 years agonptl: Move pthread_mutex_setprioceiling into libc
Florian Weimer [Fri, 23 Apr 2021 07:43:08 +0000 (09:43 +0200)]
nptl: Move pthread_mutex_setprioceiling into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_mutex_getprioceiling into libc
Florian Weimer [Fri, 23 Apr 2021 07:42:51 +0000 (09:42 +0200)]
nptl: Move pthread_mutex_getprioceiling into libc

The symbol was moved using scripts/move-symbol-to-libc.py.

3 years agopowerpc: Add optimized strlen for POWER10
Matheus Castanho [Tue, 29 Sep 2020 18:40:08 +0000 (15:40 -0300)]
powerpc: Add optimized strlen for POWER10

Improvements compared to POWER9 version:

1. Take into account first 16B comparison for aligned strings

   The previous version compares the first 16B and increments r4 by the number
   of bytes until the address is 16B-aligned, then starts doing aligned loads at
   that address. For aligned strings, this causes the first 16B to be compared
   twice, because the increment is 0. Here we calculate the next 16B-aligned
   address differently, which avoids that issue.

2. Use simple comparisons for the first ~192 bytes

   The main loop is good for big strings, but comparing 16B each time is better
   for smaller strings.  So after aligning the address to 16 Bytes, we check
   more 176B in 16B chunks.  There may be some overlaps with the main loop for
   unaligned strings, but we avoid using the more aggressive strategy too soon,
   and also allow the loop to start at a 64B-aligned address.  This greatly
   benefits smaller strings and avoids overlapping checks if the string is
   already aligned at a 64B boundary.

3. Reduce dependencies between load blocks caused by address calculation on loop

   Doing a precise time tracing on the code showed many loads in the loop were
   stalled waiting for updates to r4 from previous code blocks.  This
   implementation avoids that as much as possible by using 2 registers (r4 and
   r5) to hold addresses to be used by different parts of the code.

   Also, the previous code aligned the address to 16B, then to 64B by doing a
   few 48B loops (if needed) until the address was aligned. The main loop could
   not start until that 48B loop had finished and r4 was updated with the
   current address. Here we calculate the address used by the loop very early,
   so it can start sooner.

   The main loop now uses 2 pointers 128B apart to make pointer updates less
   frequent, and also unrolls 1 iteration to guarantee there is enough time
   between iterations to update the pointers, reducing stalled cycles.

4. Use new P10 instructions

   lxvp is used to load 32B with a single instruction, reducing contention in
   the load queue.

   vextractbm allows simplifying the tail code for the loop, replacing
   vbpermq and avoiding having to generate a permute control vector.

Reviewed-by: Paul E Murphy <murphyp@linux.ibm.com>
Reviewed-by: Raphael M Zinsly <rzinsly@linux.ibm.com>
Reviewed-by: Lucas A. M. Magalhaes <lamm@linux.ibm.com>
3 years agonptl: Do not build nptl/tst-pthread-gdb-attach as PIE
Florian Weimer [Thu, 22 Apr 2021 17:53:15 +0000 (19:53 +0200)]
nptl: Do not build nptl/tst-pthread-gdb-attach as PIE

3 years agonptl: Move pthread_kill_other_threads_np compatibility symbol into libc
Florian Weimer [Thu, 22 Apr 2021 17:50:16 +0000 (19:50 +0200)]
nptl: Move pthread_kill_other_threads_np compatibility symbol into libc

And stop including the function for new architectures.

3 years agox86: tst-cpu-features-supports.c: Update AMX check
H.J. Lu [Thu, 22 Apr 2021 01:40:08 +0000 (18:40 -0700)]
x86: tst-cpu-features-supports.c: Update AMX check

Pass "amx-bf16", "amx-int8" and "amx-tile", instead of "amx_bf16",
"amx_int8" and "amx_tile", to __builtin_cpu_supports for GCC 11.

3 years agonptl: Move pthread_atfork compatibility symbol to libc
Florian Weimer [Thu, 22 Apr 2021 14:02:59 +0000 (16:02 +0200)]
nptl: Move pthread_atfork compatibility symbol to libc

The symbol was moved using scripts/move-symbol-to-libc.py.

There is no new symbol version because of the compatibility symbol
status.  The __pthread_atfork reference in nptl/Versions was unused.

3 years agonptl: Check for compatible GDB in nptl/tst-pthread-gdb-attach
Florian Weimer [Thu, 22 Apr 2021 09:07:43 +0000 (11:07 +0200)]
nptl: Check for compatible GDB in nptl/tst-pthread-gdb-attach

Also do not clear the subprocess environment, in case running
GDB needs certain environment variables.

3 years agonptl: __nptl_set_robust_list_avail must be nocommon
Florian Weimer [Thu, 22 Apr 2021 07:56:37 +0000 (09:56 +0200)]
nptl: __nptl_set_robust_list_avail must be nocommon

This is required for GCC versions before 10 which default to -fcommon.

Fixes commit 442e8a40da9dfa24aeebf4f1a163f0a58b12cf7e ("nptl: Move part
of TCB initialization from libpthread to __tls_init_tp").

3 years agonptl: Remove remnants of the libc/libpthread forwarder interface
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Remove remnants of the libc/libpthread forwarder interface

All previously forwarded functions are now implemented in libc.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move setxid broadcast implementation into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move setxid broadcast implementation into libc

The signal handler is exported as __nptl_setxid_sighandler, so
that the libpthread initialization code can install it.  This
is sufficient for now because it is guarantueed to happen before
the first pthread_create call.

3 years agonptl: Move core condition variable functions into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move core condition variable functions into libc

Onl pthread_cond_clockwait did not have a forwarder, so it needs
a new symbol version.

Some complications arise due to the need to supply hidden aliases,
GLIBC_PRIVATE exports (for the C11 condition variable implementation
that still remains in libpthread) and 64-bit time_t stubs.

pthread_cond_broadcast, pthread_cond_signal,  pthread_cond_timedwait,
pthread_cond_wait, pthread_cond_clockwait have been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move core mutex functions into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move core mutex functions into libc

This is complicated because of a second compilation of
nptl/pthread_mutex_lock.c via nptl/pthread_mutex_cond_lock.c.
PTHREAD_MUTEX_VERSIONS is introduced to suppress symbol versions
in that case.

The symbols __pthread_mutex_lock, __pthread_mutex_unlock,
__pthread_mutex_init, __pthread_mutex_destroy, pthread_mutex_lock,
pthread_mutex_unlock, pthread_mutex_init, pthread_mutex_destroy
have been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agox86: Remove low-level lock optimization
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
x86: Remove low-level lock optimization

The current approach is to do this optimizations at a higher level,
in generic code, so that single-threaded cases can be specifically
targeted.

Furthermore, using IS_IN (libc) as a compile-time indicator that
all locks are private is no longer correct once process-shared lock
implementations are moved into libc.

The generic <lowlevellock.h> is not compatible with assembler code
(obviously), so it's necessary to remove two long-unused #includes.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: pthread_mutex_lock, pthread_mutex_unock single-threaded optimization
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: pthread_mutex_lock, pthread_mutex_unock single-threaded optimization

This is optimization is similar in spirit to the SINGLE_THREAD_P check
in the malloc implementation.  Doing this in generic code allows us
to prioritize those cases which are likely to occur in single-threaded
programs (normal and recursive mutexes).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move internal symbol __mutex_aconf into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move internal symbol __mutex_aconf into libc

This is in preparation of moving the mutex code into libc.

__pthread_tunables_init is now called via __pthread_early_init.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agopthread: Introduce __pthread_early_init
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
pthread: Introduce __pthread_early_init

This function is called from __libc_early_init to initialize the
pthread subsystem.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move the internal thread priority protection symbols into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move the internal thread priority protection symbols into libc

This is a prerequisite for moving the mutex implementation.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move rwlock functions with forwarders into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move rwlock functions with forwarders into libc

The forwarders were only used internally, so new symbol versions
are needed.  All symbols are moved at once because the forwarders
are no-ops if libpthread is not loaded, leading to inconsistencies
in case of a partial migration.

The symbols __pthread_rwlock_rdlock, __pthread_rwlock_unlock,
__pthread_rwlock_wrlock, pthread_rwlock_rdlock,
pthread_rwlock_unlock, pthread_rwlock_wrlock have been moved using
scripts/move-symbol-to-libc.py.

The __ symbol variants are turned into compat symbols, which is why they
do not receive a GLIBC_2.34 version.

3 years agonptl: Move pthread_key_delete into libc.
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move pthread_key_delete into libc.

The symbol was moved using scripts/move-symbol-to-libc.py.

tss_delete (still in libpthread) uses the __pthread_key_create
alias, so that is now exported under GLIBC_PRIVATE.

3 years agonptl: Move pthread_setspecific, __pthread_setspecific into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move pthread_setspecific, __pthread_setspecific into libc

The symbols have been moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_getspecific, __pthread_getspecific into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move pthread_getspecific, __pthread_getspecific into libc

The symbols have been moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move pthread_key_create, __pthread_key_create into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move pthread_key_create, __pthread_key_create into libc

The symbols have been moved using scripts/move-symbol-to-libc.py.

3 years agonptl: Move part of TCB initialization from libpthread to __tls_init_tp
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Move part of TCB initialization from libpthread to __tls_init_tp

This initalization should only happen once for the main thread's TCB.
At present, auditors can achieve this by not linking against
libpthread.  If libpthread becomes part of libc, doing this
initialization in libc would happen for every audit namespace,
or too late (if it happens from the main libc only).  That's why
moving this code into ld.so seems the right thing to do, right after
the TCB initialization.

For !__ASSUME_SET_ROBUST_LIST ports, this also moves the symbol
__set_robust_list_avail into ld.so, as __nptl_set_robust_list_avail.
It also turned into a proper boolean flag.

Inline the __pthread_initialize_pids function because it seems no
longer useful as a separate function.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agoelf: Introduce __tls_init_tp for second-phase TCB initialization
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
elf: Introduce __tls_init_tp for second-phase TCB initialization

TLS_INIT_TP is processor-specific, so it is not a good place to
put thread library initialization code (it would have to be repeated
for all CPUs).  Introduce __tls_init_tp as a separate function,
to be called immediately after TLS_INIT_TP.  Move the existing
stack list setup code for NPTL to this function.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agoRemove pthread_key_create-related internals from libc-lock.h
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
Remove pthread_key_create-related internals from libc-lock.h

And libc-lockP.h.  This is no longer used because all internal
TLS use goes directly to the thread descriptor/TCB or uses ELF TLS.

3 years agodlfcn: dlerror needs to call free from the base namespace [BZ #24773]
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
dlfcn: dlerror needs to call free from the base namespace [BZ #24773]

Calling free directly may end up freeing a pointer allocated by the
dynamic loader using malloc from libc.so in the base namespace using
the allocator from libc.so in a secondary namespace, which results in
crashes.

This commit redirects the free call through GLRO and the dynamic
linker, to reach the correct namespace.  It also cleans up the dlerror
handling along the way, so that pthread_setspecific is no longer
needed (which avoids triggering bug 24774).

3 years agodlfcn: Failures after dlmopen should not terminate process [BZ #24772]
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
dlfcn: Failures after dlmopen should not terminate process [BZ #24772]

Commit 9e78f6f6e7134a5f299cc8de77370218f8019237 ("Implement
_dl_catch_error, _dl_signal_error in libc.so [BZ #16628]") has the
side effect that distinct namespaces, as created by dlmopen, now have
separate implementations of the rtld exception mechanism.  This means
that the call to _dl_catch_error from libdl in a secondary namespace
does not actually install an exception handler because the
thread-local variable catch_hook in the libc.so copy in the secondary
namespace is distinct from that of the base namepace.  As a result, a
dlsym/dlopen/... failure in a secondary namespace terminates the process
with a dynamic linker error because it looks to the exception handler
mechanism as if no handler has been installed.

This commit restores GLRO (dl_catch_error) and uses it to set the
handler in the base namespace.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Invoke the set_robust_list system call directly in fork
Florian Weimer [Wed, 21 Apr 2021 17:49:51 +0000 (19:49 +0200)]
nptl: Invoke the set_robust_list system call directly in fork

This removes one of the pthread forwarder functions.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move pthread_setcanceltype into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move pthread_setcanceltype into libc

No new symbol version is required because there was a forwarder.

The symbol has been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move pthread_setcancelstate into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move pthread_setcancelstate into libc

No new symbol version is required because there was a forwarder.

The symbol has been moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move pthread_exit into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move pthread_exit into libc

The pthread_exit symbol was moved using
scripts/move-symbol-to-libc.py.  No new symbol version is needed
because there was a forwarder.

The new tests nptl/tst-pthread_exit-nothreads and
nptl/tst-pthread_exit-nothreads-static exercise the scenario
that pthread_exit is called without libpthread having been linked in.
This is not possible for the generic code, so these tests do not
live in sysdeps/pthread for now.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move __nptl_deallocate_tsd into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move __nptl_deallocate_tsd into libc

This prepares moving pthread_exit, and later the pthread_key_create
infrastructure.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move __pthread_keys global variable into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move __pthread_keys global variable into libc

This prepares moving pthread_exit, and later the pthread_key_create
infrastructure.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl_db: Introduce DB_MAIN_ARRAY_VARIABLE
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl_db: Introduce DB_MAIN_ARRAY_VARIABLE

And document the reason for DB_ARRAY_VARIABLE.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move internal __nptl_nthreads variable into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move internal __nptl_nthreads variable into libc

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agocsu: Move calling main out of __libc_start_main_impl
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
csu: Move calling main out of __libc_start_main_impl

This code depends on whether glibc has unwinding support for
a particular port.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move __pthread_unwind_next into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move __pthread_unwind_next into libc

It's necessary to stub out __libc_disable_asynccancel and
__libc_enable_asynccancel via rtld-stubbed-symbols because the new
direct references to the unwinder result in symbol conflicts when the
rtld exception handling from libc is linked in during the construction
of librtld.map.

unwind-forcedunwind.c is merged into unwind-resume.c.  libc now needs
the functions that were previously only used in libpthread.

The GLIBC_PRIVATE exports of __libc_longjmp and __libc_siglongjmp are
no longer needed, so switch them to hidden symbols.

The symbol __pthread_unwind_next has been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerva Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move pthread_once and __pthread_once into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move pthread_once and __pthread_once into libc

And also the fork generation counter, __fork_generation.  This
eliminates the need for __fork_generation_pointer.

call_once remains in libpthread and calls the exported __pthread_once
symbol.

pthread_once and __pthread_once have been moved using
scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move __pthread_cleanup_upto into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move __pthread_cleanup_upto into libc

This internal symbol is used as part of the longjmp implementation.
Rename the file from nptl/pt-cleanup.c to nptl/pthread_cleanup_upto.c
so that the pt-* files remain restricted to libpthread.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agox86: Restore compile-time check for shadow stack pointer in longjmp
Adhemerval Zanella [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
x86: Restore compile-time check for shadow stack pointer in longjmp

3 years agonptl: Remove longjmp, siglongjmp from libpthread
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Remove longjmp, siglongjmp from libpthread

The definitions in libc are sufficient, the forwarders are no longer
needed.

The symbols have been moved using scripts/move-symbol-to-libc.py.
s390-linux-gnu and s390x-linux-gnu need a new version placeholder
to keep the GLIBC_2.19 symbol version in libpthread.

Tested on i386-linux-gnu, powerpc64le-linux-gnu, s390x-linux-gnu,
x86_64-linux-gnu.  Built with build-many-glibcs.py.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move legacy cancelation handling into libc as compat symbols
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move legacy cancelation handling into libc as compat symbols

This affects _pthread_cleanup_pop, _pthread_cleanup_pop_restore,
_pthread_cleanup_push, _pthread_cleanup_push_defer.  The symbols
have been moved using scripts/move-symbol-to-libc.py.

No new symbol versions are added because the symbols are turned into
compatibility symbols at the same time.

__pthread_cleanup_pop and __pthread_cleanup_push are added as
GLIBC_PRIVATE symbols because they are also used internally, for
glibc's own cancellation handling.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move legacy unwinding implementation into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move legacy unwinding implementation into libc

It is still used internally.  Since unwinding is now available
unconditionally, avoid indirect calls through function pointers loaded
from the stack by inlining the non-cancellation cleanup code.  This
avoids a regression in security hardening.

The out-of-line  __libc_cleanup_routine implementation is no longer
needed because the inline definition is now static __always_inline.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move __pthread_cleanup_routine into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move __pthread_cleanup_routine into libc

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agonptl: Move pthread_mutex_consistent into libc
Florian Weimer [Wed, 21 Apr 2021 17:49:50 +0000 (19:49 +0200)]
nptl: Move pthread_mutex_consistent into libc

And deprecated pthread_mutex_consistent_np, its old name.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agoelf: Remove lazy tlsdesc relocation related code
Szabolcs Nagy [Thu, 11 Feb 2021 13:24:47 +0000 (13:24 +0000)]
elf: Remove lazy tlsdesc relocation related code

Remove generic tlsdesc code related to lazy tlsdesc processing since
lazy tlsdesc relocation is no longer supported.  This includes removing
GL(dl_load_lock) from _dl_make_tlsdesc_dynamic which is only called at
load time when that lock is already held.

Added a documentation comment too.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
3 years agoFix argv overrun in getconf (bug 27761)
Andreas Schwab [Wed, 21 Apr 2021 12:27:21 +0000 (14:27 +0200)]
Fix argv overrun in getconf (bug 27761)

Correct argument counter accounting when processing the -v option with the
argument directly attached.

3 years agonptl_db: Support different libpthread/ld.so load orders (bug 27744)
Florian Weimer [Wed, 21 Apr 2021 09:50:43 +0000 (11:50 +0200)]
nptl_db: Support different libpthread/ld.so load orders (bug 27744)

libthread_db is loaded once GDB encounters libpthread, and at this
point, ld.so may not have been processed by GDB yet. As a result,
_rtld_global cannot be accessed by regular means from libthread_db.
To make this work until GDB can be fixed, acess _rtld_global through
a pointer stored in libpthread.

The new test does not reproduce bug 27744 with
--disable-hardcoded-path-in-tests, but is still a valid smoke test.
With --enable-hardcoded-path-in-tests, it is necessary to avoid
add-symbol-file because this can tickle a GDB bug.

Fixes commit 1daccf403b1bd86370eb94edca794dc106d02039 ("nptl: Move
stack list variables into _rtld_global").

Tested-by: Emil Velikov <emil.velikov@collabora.com>
3 years agox86: Optimize strlen-avx2.S
Noah Goldstein [Mon, 19 Apr 2021 23:36:07 +0000 (19:36 -0400)]
x86: Optimize strlen-avx2.S

No bug. This commit optimizes strlen-avx2.S. The optimizations are
mostly small things but they add up to roughly 10-30% performance
improvement for strlen. The results for strnlen are bit more
ambiguous. test-strlen, test-strnlen, test-wcslen, and test-wcsnlen
are all passing.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agox86: Optimize strlen-evex.S
Noah Goldstein [Mon, 19 Apr 2021 23:36:06 +0000 (19:36 -0400)]
x86: Optimize strlen-evex.S

No bug. This commit optimizes strlen-evex.S. The
optimizations are mostly small things but they add up to roughly
10-30% performance improvement for strlen. The results for strnlen are
bit more ambiguous. test-strlen, test-strnlen, test-wcslen, and
test-wcsnlen are all passing.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agoReindent string/test-memmove.c
H.J. Lu [Tue, 20 Apr 2021 00:46:05 +0000 (17:46 -0700)]
Reindent string/test-memmove.c

3 years agox86: Expand test-memset.c and bench-memset.c
Noah Goldstein [Mon, 19 Apr 2021 21:48:11 +0000 (17:48 -0400)]
x86: Expand test-memset.c and bench-memset.c

No bug. This commit adds tests cases and benchmarks for page cross and
for memset to the end of the page without crossing. As well in
test-memset.c this commit adds sentinel on start/end of tstbuf to test
for overwrites

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agox86: Optimize less_vec evex and avx512 memset-vec-unaligned-erms.S
Noah Goldstein [Mon, 19 Apr 2021 21:48:10 +0000 (17:48 -0400)]
x86: Optimize less_vec evex and avx512 memset-vec-unaligned-erms.S

No bug. This commit adds optimized cased for less_vec memset case that
uses the avx512vl/avx512bw mask store avoiding the excessive
branches. test-memset and test-wmemset are passing.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agox86-64: Require BMI2 for strchr-avx2.S
H.J. Lu [Mon, 19 Apr 2021 17:45:07 +0000 (10:45 -0700)]
x86-64: Require BMI2 for strchr-avx2.S

Since strchr-avx2.S updated by

commit 1f745ecc2109890886b161d4791e1406fdfc29b8
Author: noah <goldstein.w.n@gmail.com>
Date:   Wed Feb 3 00:38:59 2021 -0500

    x86-64: Refactor and improve performance of strchr-avx2.S

uses sarx:

c4 e2 72 f7 c0        sarx   %ecx,%eax,%eax

for strchr-avx2 family functions, require BMI2 in ifunc-impl-list.c and
ifunc-avx2.h.

3 years agox86-64: Require BMI2 for __strlen_evex and __strnlen_evex
H.J. Lu [Mon, 19 Apr 2021 14:07:21 +0000 (07:07 -0700)]
x86-64: Require BMI2 for __strlen_evex and __strnlen_evex

Since __strlen_evex and __strnlen_evex added by

commit 1fd8c163a83d96ace1ff78fa6bac7aee084f6f77
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 5 06:24:52 2021 -0800

    x86-64: Add ifunc-avx2.h functions with 256-bit EVEX

use sarx:

c4 e2 6a f7 c0        sarx   %edx,%eax,%eax

require BMI2 for __strlen_evex and __strnlen_evex in ifunc-impl-list.c.
ifunc-avx2.h already requires BMI2 for EVEX implementation.

3 years agobenchtests: Fix name of exp10f benchmark variant
Siddhesh Poyarekar [Sun, 18 Apr 2021 07:09:12 +0000 (12:39 +0530)]
benchtests: Fix name of exp10f benchmark variant

Variant names don't accept brackets.

3 years agobenchtests: Fix pthread-locks test to produce valid json
Siddhesh Poyarekar [Sun, 18 Apr 2021 07:19:54 +0000 (12:49 +0530)]
benchtests: Fix pthread-locks test to produce valid json

The benchtests json allows {function {variant}} categorization of
results whereas the pthread-locks tests had {function {variant
{subvariant}}}, which broke validation.  Fix that by serializing the
subvariants as variant-subvariant.  Also update the schema to
recognize the new benchmark attributes after fixing the naming
conventions.

3 years agox86: Expanding test-memmove.c, test-memcpy.c, bench-memcpy-large.c
noah [Sat, 3 Apr 2021 08:12:16 +0000 (04:12 -0400)]
x86: Expanding test-memmove.c, test-memcpy.c, bench-memcpy-large.c

No Bug. This commit expanding the range of tests / benchmarks for
memmove and memcpy. The test expansion is mostly in the vein of
increasing the maximum size, increasing the number of unique
alignments tested, and testing both source < destination and vice
versa. The benchmark expansaion is just to increase the number of
unique alignments. test-memcpy, test-memccpy, test-mempcpy,
test-memmove, and tst-memmove-overflow all pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agoSet the retain attribute on _elf_set_element if CC supports [BZ #27492]
Fangrui Song [Fri, 16 Apr 2021 18:26:39 +0000 (11:26 -0700)]
Set the retain attribute on _elf_set_element if CC supports [BZ #27492]

So that text_set_element/data_set_element/bss_set_element defined
variables will be retained by the linker.

Note: 'used' and 'retain' are orthogonal: 'used' makes sure the variable
will not be optimized out; 'retain' prevents section garbage collection
if the linker support SHF_GNU_RETAIN.

GNU ld 2.37 and LLD 13 will support -z start-stop-gc which allow C
identifier name sections to be GCed even if there are live
__start_/__stop_ references.

Without the change, there are some static linking problems, e.g.
_IO_cleanup (libio/genops.c) may be discarded by ld --gc-sections, so
stdout is not flushed on exit.

Note: GCC may warning 'retain' attribute ignored while __has_attribute(retain)
is 1 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587).

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
3 years agox86: Update large memcpy case in memmove-vec-unaligned-erms.S
noah [Sat, 3 Apr 2021 08:12:15 +0000 (04:12 -0400)]
x86: Update large memcpy case in memmove-vec-unaligned-erms.S

No Bug. This commit updates the large memcpy case (no overlap). The
update is to perform memcpy on either 2 or 4 contiguous pages at
once. This 1) helps to alleviate the affects of false memory aliasing
when destination and source have a close 4k alignment and 2) In most
cases and for most DRAM units is a modestly more efficient access
pattern. These changes are a clear performance improvement for
VEC_SIZE =16/32, though more ambiguous for VEC_SIZE=64. test-memcpy,
test-memccpy, test-mempcpy, test-memmove, and tst-memmove-overflow all
pass.

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 years agopowerpc: Add missing registers to clobbers list for syscalls [BZ #27623]
Matheus Castanho [Wed, 17 Mar 2021 13:14:15 +0000 (10:14 -0300)]
powerpc: Add missing registers to clobbers list for syscalls [BZ #27623]

Some registers that can be clobbered by the kernel during a syscall are not
listed on the clobbers list in sysdeps/unix/sysv/linux/powerpc/sysdep.h.

For syscalls using sc:
    - XER is zeroed by the kernel on exit

For syscalls using scv:
    - XER is zeroed by the kernel on exit
    - Different from the sc case, most CR fields can be clobbered (according to
      the ELF ABI and the Linux kernel's syscall ABI for powerpc
      (linux/Documentation/powerpc/syscall64-abi.rst)

The same should apply to vsyscalls, which effectively execute a function call
but are not currently adding these registers as clobbers either.

These are likely not causing issues today, but they should be added to the
clobbers list just in case things change on the kernel side in the future.

Reported-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Raphael M Zinsly <rzinsly@linux.ibm.com>
3 years agomisc: syslog: Use static const for AF_UNIX address
Adhemerval Zanella [Sun, 11 Apr 2021 02:42:12 +0000 (23:42 -0300)]
misc: syslog: Use static const for AF_UNIX address

Checked on x86_64-linux-gnu.

3 years agomisc: syslog: Use CLOC_EXEC with _PATH_CONSOLE (BZ #17145)
Adhemerval Zanella [Sun, 11 Apr 2021 02:29:40 +0000 (23:29 -0300)]
misc: syslog: Use CLOC_EXEC with _PATH_CONSOLE (BZ #17145)

The syslog open the '/dev/console' for LOG_CONS without O_CLOEXEC,
which might leak in multithread programs that call fork.

Checked on x86_64-linux-gnu.

3 years agomisc: syslog: Assume MSG_NOSIGNAL support (BZ #17144)
Adhemerval Zanella [Fri, 9 Apr 2021 18:53:04 +0000 (15:53 -0300)]
misc: syslog: Assume MSG_NOSIGNAL support (BZ #17144)

MSG_NOSIGNAL was added on POSIX 2008 and Hurd seems to support it.
The SIGPIPE handling also makes the implementation not thread-safe
(due the sigaction usage).

Checked on x86_64-linux-gnu.

3 years agomisc: syslog: Use bool for connected
Adhemerval Zanella [Fri, 9 Apr 2021 18:40:20 +0000 (15:40 -0300)]
misc: syslog: Use bool for connected

Checked on x86_64-linux-gnu.