Commit Graph

6040 Commits

Author SHA1 Message Date
Adhemerval Zanella
a894053318 signal: Add __libc_sigaction
The generic implementation basically handle the system agnostic logic
(filtering out the invalid signals) while the __libc_sigaction is
the function with implements the system and architecture bits.

Checked on x86_64-linux-gnu and i686-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
d5ddd583da nptl: Move system to libc
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
9cf242997d nptl: Move fcntl from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
729cb5a2a7 nptl: Remove sendmsg from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
0cf67de816 nptl: Remove recvmsg from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
2d6f4ebd65 nptl: Remove sigwait from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
1e157b9cb4 nptl: Remove tcdrain from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
c29386fd50 nptl: Remove pause from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
0c9d4925fe nptl: Remove msync from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
fc495dc4e9 nptl: Remove fsync from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
6f2e00cac5 nptl: Remove sendto from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
643a88a9c1 nptl: Remove recvfrom from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
494c3beec9 nptl: Remove recv from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
3ddf9bc185 nptl: Remove connect from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:39 -03:00
Adhemerval Zanella
c59f716993 nptl: Remove accept from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:38 -03:00
Adhemerval Zanella
bdfed2e2cd nptl: Remove close from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 15:54:24 -03:00
Adhemerval Zanella
baab50cfb9 nptl: Remove read from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:21:29 -03:00
Adhemerval Zanella
173e0ab081 nptl: Remove write from libpthread
The libc version is identical and built with same flags.

Checked on x86_64-linux-gnu.
2021-03-18 08:20:43 -03:00
Adhemerval Zanella
7384193b71 nptl: Move fork into libc
This is part of the libpthread removal project:

   <https://sourceware.org/ml/libc-alpha/2019-10/msg00080.html>

Checked on x86_64-linux-gnu.
2021-03-12 10:19:58 -03:00
Adhemerval Zanella
cdba937662 nptl: Move Linux pthread_kill to nptl
The nptl already expects a Linux syscall internally.  Also
__is_internal_signal is used and the DEBUGGING_P check is removed.

Checked on x86_64-linux-gnu.
2021-03-12 10:19:03 -03:00
Adhemerval Zanella
b2970919ba io: Return UNSUPPORTED if filesystem do not support 64 bit timestamps
Some Linux filesystems might not fully support 64 bit timestamps [1],
which make some Linux specific tests to fail when they check for the
functionality.

This patch adds a new libsupport function, support_path_support_time64,
that returns whether the target file supports or not 64 bit timestamps.
The support is checked by issuing a utimensat and verifying both the
last access and last modification time against a statx call.

The tests that might fail are also adjusted to check the file support
as well:

  $ dd if=/dev/zero of=loopbackfile.img bs=100M count=1
  1+0 records in
  1+0 records out
  104857600 bytes (105 MB, 100 MiB) copied, 0,0589568 s, 1,8 GB/s
  $ sudo losetup -fP loopbackfile.img
  $ mkfs.xfs loopbackfile.img
  meta-data=loopbackfile.img       isize=512    agcount=4, agsize=6400 blks
           =                       sectsz=512   attr=2, projid32bit=1
           =                       crc=1        finobt=1, sparse=1, rmapbt=0
           =                       reflink=1
  data     =                       bsize=4096   blocks=25600, imaxpct=25
           =                       sunit=0      swidth=0 blks
  naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
  log      =internal log           bsize=4096   blocks=1368, version=2
           =                       sectsz=512   sunit=0 blks, lazy-count=1
  realtime =none                   extsz=4096   blocks=0, rtextents=0
  $ mkdir loopfs
  $ sudo mount -o loop /dev/loop0 loopfs/
  $ sudo chown -R azanella:azanella loopfs
  $ TMPDIR=loopfs/ ./testrun.sh misc/tst-utimes
  error: ../sysdeps/unix/sysv/linux/tst-utimes.c:55: File loopfs//utimesfECsK1 does not support 64-bit timestamps

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1795576
2021-03-12 10:17:31 -03:00
Adhemerval Zanella
94caafa040 io: Return EBAFD for negative file descriptor on fstat (BZ #27559)
Now that fstat is implemented on top fstatat we need to handle negative
inputs.  The implementation now rejects AT_FDCWD, which would otherwise
be accepted by the kernel.

Checked on x86_64-linux-gnu and on i686-linux-gnu.
2021-03-11 10:51:55 -03:00
Joseph Myers
d891f55562 Update kernel version to 5.11 in tst-mman-consts.py.
This patch updates the kernel version in the test tst-mman-consts.py
to 5.11.  (There are no new MAP_* constants covered by this test in
5.11 that need any other header changes.)

Tested with build-many-glibcs.py.
2021-03-10 14:26:57 +00:00
Florian Weimer
a6917c82b3 Linux: misc/tst-ofdlocks-compat can be a regular test
Now that compat_symbol_reference works in non-internal tests.
Also do not build and run the test at all on architectures which
do not have the pre-2.28 symbol version of fcntl.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-09 21:07:24 +01:00
Florian Weimer
15e50e6c96 Linux: dirent/tst-readdir64-compat can be a regular test
compat_symbol_reference works in non-internal tests now.  Also
avoid building the test for unsupported configurations at all.
I verified by building with build-many-glibcs.py that GLIBC_2.1.3
works as the predecessor of GLIBC_2.2.  (Symbol versions in
the early days are complex.)

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-09 21:07:24 +01:00
Lukasz Majewski
6b6a151c77 tst: Add test for ntp_adjtime
This test is a wrapper on tst-clock_adjtime test.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
39f39cade3 tst: Add test for adjtimex
This test is a wrapper on tst-clock_adjtime test.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
4de01867dc tst: Modify tst-clock_adjtime to allow reuse of its code
The tst-clock_adjtime can be adjusted to be reused for also testing
adjtimex.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Lukasz Majewski
b4effffde8 tst: Add test for clock_adjtime
This code privides test to check if time on target machine is properly
adjusted.
The time is altered only when cross-test-ssh.sh is executed with
--allow-time-setting flag.
As the delta added to CLOCK_REALTIME is only 1 sec the original time is
not restored and further tests are executed with this bias.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-08 22:41:41 +01:00
Adhemerval Zanella
4b9bedbc90 linux: Fix __thrd_sleep64 hidden definition
The symbol is exported by libc.
2021-03-05 08:35:50 -03:00
Lukasz Majewski
dd1776e327 tst: Fix tst-timerfd test
There were following problems discovered for tst-timerfd test:

1. Do not set the struct itimerspec's it_interval tv_sec to 2 seconds.
After this change the timerfd will trigger only once (the it_value is
only set in this case).

2. The 'val1' variable (including the call to timerfd_gettime) is not
needed anymore, as it is just enough to read the struct itimerspec
after sleep. As a consequence the 'val2' has been renamed to 'val'.

3. After calling timerfd_gettime, the value of struct itimerspec time,
when timer is running, is the remaining time. In the case of this test
it would be less than 1 second.
As a result the TEST_COMPARE macro logic had to be adjusted.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 16:55:05 +01:00
Florian Weimer
851f32cf7b ld.so: Implement the --list-diagnostics option 2021-03-02 14:39:24 +01:00
Lukasz Majewski
9871ae0ab4 tst: Add test for utimes
This patch provides test for utimes. It uses wrapper to read
access and modification times to compare them with ones written by
utimes.

Moreover, access and modification times beyond the Y2038 threshold
date (i.e. 32 bit time_t overflow) are also checked.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 13:31:13 +01:00
Lukasz Majewski
dec445d40d tst: Add test for utime
This patch provides test for utime. It uses wrapper to read access
and modification times to compare them with ones written by utime.

Moreover, access and modification times beyond the Y2038 threshold
date (i.e. 32 bit time_t overflow) are also checked.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 13:31:13 +01:00
Lukasz Majewski
e0685bacd5 tst: Add test for futimens
This patch provides test for futimens. It uses wrapper, which
reads access and modification time to compare them with ones
written by futimens.

Moreover, access and modification times beyond the Y2038 threshold
date (i.e. 32 bit time_t overflow) are also checked.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2021-03-02 13:31:13 +01:00
Florian Weimer
97e42bd482 nptl: Use <unwind-link.h> for accessing the libgcc_s unwinder
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-03-01 16:00:22 +01:00
Florian Weimer
9fc813e1a3 Implement <unwind-link.h> for dynamically loading the libgcc_s unwinder
This will be used to consolidate the libgcc_s access for backtrace
and pthread_cancel.

Unlike the existing backtrace implementations, it provides some
hardening based on pointer mangling.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-03-01 15:58:01 +01:00
Florian Weimer
035c012e32 Reduce the statically linked startup code [BZ #23323]
It turns out the startup code in csu/elf-init.c has a perfect pair of
ROP gadgets (see Marco-Gisbert and Ripoll-Ripoll, "return-to-csu: A
New Method to Bypass 64-bit Linux ASLR").  These functions are not
needed in dynamically-linked binaries because DT_INIT/DT_INIT_ARRAY
are already processed by the dynamic linker.  However, the dynamic
linker skipped the main program for some reason.  For maximum
backwards compatibility, this is not changed, and instead, the main
map is consulted from __libc_start_main if the init function argument
is a NULL pointer.

For statically linked binaries, the old approach based on linker
symbols is still used because there is nothing else available.

A new symbol version __libc_start_main@@GLIBC_2.34 is introduced because
new binaries running on an old libc would not run their ELF
constructors, leading to difficult-to-debug issues.
2021-02-25 12:13:02 +01:00
Florian Weimer
5a664d7ae8 nptl: Move elision implementations into libc
The elision interfaces are closely aligned between the targets that
implement them, so declare them in the generic <lowlevellock.h>
file.

Empty .c stubs are provided, so that fewer makefile updates
under sysdeps are needed.  Also simplify initialization via
__libc_early_init.

The symbols __lll_clocklock_elision, __lll_lock_elision,
__lll_trylock_elision, __lll_unlock_elision, __pthread_force_elision
move into libc.  For the time being, non-hidden references are used
from libpthread to access them, but once that part of libpthread
is moved into libc, hidden symbols will be used again.  (Hidden
references seem desirable to reduce the likelihood of transactions
aborts.)
2021-02-23 14:59:34 +01:00
H.J. Lu
ebbb8c9f64 x86_64/clone.S: Upate comments 2021-02-22 04:30:38 -08:00
H.J. Lu
f8ff5a3cc2 i386/clone.S: Remove redundant EBX load
There is no neeed for

	call	L(here)
L(here):
	popl	%ebx
	addl	$_GLOBAL_OFFSET_TABLE_+[.-L(here)], %ebx

before

	movl	%eax, %ebx
2021-02-22 04:29:19 -08:00
Szabolcs Nagy
fb37ef6960 aarch64: Remove the unused __read_tp symbol
This was likely a mistake in the original aarch64 port copied over
from arm: on aarch64 tpidr_el0 register is always available.

The __read_tp symbol is visible with static linking, but it's not
part of the public ABI so it should be safe to remove.
2021-02-22 09:17:12 +00:00
Joseph Myers
83908b3a1e Update syscall lists for Linux 5.11.
Linux 5.11 has one new syscall, epoll_pwait2.  Update
syscall-names.list and regenerate the arch-syscall.h headers with
build-many-glibcs.py update-syscalls.

Tested with build-many-glibcs.py.
2021-02-19 21:16:27 +00:00
John David Anglin
96b8038f12 Correct hppa EFD_NONBLOCK, IN_NONBLOCK, SFD_NONBLOCK and TFD_NONBLOCK defines. 2021-02-19 17:08:47 +00:00
Stefan Liebler
25251c0707 S390: Add new hwcap values.
The new hwcap values indicate support for arch14 architecture.
2021-02-16 16:31:20 +01:00
Szabolcs Nagy
fb1905eed8 aarch64: Fix sys/ptrace.h if linux headers are included
If the linux asm/ptrace.h is included before sys/ptrace.h that
breaks the newly added declarations there, so undef the names
that may be defined as macros in the linux header.
2021-02-15 13:42:01 +00:00
Adhemerval Zanella
7eb3000f9f linux: Remove stat-check.c
The check is moved to LFS fstatat implementation (since it is the
code that actually implements the syscall).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-02-11 08:02:16 -03:00
Adhemerval Zanella
d2fa24f239 linux: Remove overflow.h
The header is not used anywhere.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-02-11 08:01:10 -03:00
Adhemerval Zanella
1566d3c43f linux: Consolidate internal_statvfs
Remove the internal_statvfs64.c and open code the implementation
on internal_statvfs.c.  The alpha is now unrequired, the generic
implementation also handles it.

Also, remove unused includes on internal_statvfs.c, and remove
unused arguments on __internal_statvfs{64}.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-02-11 08:00:48 -03:00
Adhemerval Zanella
52f527d6f1 linux: Consolidate statvfs implementations
There is no need to handle ENOSYS on fstatfs64 call, required only
for alpha (where is already fallbacks to fstatfs).

Checked on x86_64-linux-gnu.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2021-02-11 08:00:41 -03:00