aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-05-23Fix misspellings in sysdeps/x86_64 -- BZ 25337.Paul Pluzhnikov37-105/+105
Applying this commit results in bit-identical rebuild of libc.so.6 math/libm.so.6 elf/ld-linux-x86-64.so.2 mathvec/libmvec.so.1 Reviewed-by: Florian Weimer <fweimer@redhat.com>
2023-05-23mach: Fix accessing mach_i386.hSamuel Thibault4-4/+8
Fixes: 196358ae26aa ("mach: Fix installing mach_i386.h")
2023-05-23Fix misspellings in sysdeps/x86_64/fpu/multiarch -- BZ 25337.Paul Pluzhnikov112-169/+169
Applying this commit results in a bit-identical rebuild of mathvec/libmvec.so.1 (which is the only binary that gets rebuilt). Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-05-23mach: Fix installing mach_i386.hSamuel Thibault2-2/+2
We do not want mach_i386.h to get installed into machine/, but into i386/ or x86_64/ depending where mach_i386.defs was found, i.e. according to 32/64 bitness.
2023-05-23hurd: Fix making ld.so run static binaries with retrySamuel Thibault1-1/+1
We need O_EXEC for __rtld_execve
2023-05-22Add voice-admit DSCP code point from RFC-5865Ronan Pigott1-0/+5
2023-05-22mach: Fix mach_setup_thread_impl with NULL stack_baseSamuel Thibault1-7/+7
This is notably necessary for running the gmon thread.
2023-05-22Remove last remnants of have-protectedAndreas Schwab3-9/+1
2023-05-22S390: Use compile-only instead of also link-tests in configure.Stefan Liebler2-177/+109
Some of the s390-specific configure checks are using compile and link configure tests. Now use only compile tests as the link tests fails when e.g. bootstrapping a cross-toolchain due to missing crt-files/libc.so. This is achieved by using AC_COMPILE_IFELSE in configure.ac file. This is observable e.g. when using buildroot which builds glibc only once or the build-many-glibcs.py script. Note that the latter one is building glibc twice in the compilers-step (configure-checks fails) and in the glibcs-step (configure-checks succeed). Note, that the s390 specific configure tests for static PIE have to link an executable to test binutils support. Thus we can't fix those tests.
2023-05-22Fix build for hurd/thread-self.c for i386.Flavio Cruz1-0/+1
We need to include hurd.h for libc_hidden_proto (__hurd_thread_self), introduced in b44c1e12524b ("hurd: Fix using interposable hurd_thread_self") This the error log: In file included from <command-line>: ./../include/libc-symbols.h:472:33: error: '__EI___hurd_thread_self' aliased to undefined symbol '__GI___hurd_thread_self' 472 | extern thread __typeof (name) __EI_##name \ | ^~~~~ ./../include/libc-symbols.h:468:3: note: in expansion of macro '__hidden_ver2' 468 | __hidden_ver2 (, local, internal, name) | ^~~~~~~~~~~~~ ./../include/libc-symbols.h:476:41: note: in expansion of macro '__hidden_ver1' 476 | # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); | ^~~~~~~~~~~~~ ./../include/libc-symbols.h:557:32: note: in expansion of macro 'hidden_def' 557 | # define libc_hidden_def(name) hidden_def (name) | ^~~~~~~~~~ thread-self.c:27:1: note: in expansion of macro 'libc_hidden_def' 27 | libc_hidden_def (__hurd_thread_self) | ^~~~~~~~~~~~~~~ Message-Id: <ZGr6wj2UOxg3F0qH@jupiter.tail36e24.ts.net>
2023-05-20io: Fix a typoSergey Bugaev1-2/+2
Fixes 85f7554cd97e7f03d8dc66278653045ef63a2221 "Add test case for O_TMPFILE handling in open, openat" Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230520115531.3911877-3-bugaevc@gmail.com>
2023-05-20htl: Use __hurd_fail () instead of assigning errnoSergey Bugaev4-18/+9
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230520115531.3911877-2-bugaevc@gmail.com>
2023-05-20hurd: Use __hurd_fail () instead of assigning errnoSergey Bugaev49-278/+109
The __hurd_fail () inline function is the dedicated, idiomatic way of reporting errors in the Hurd part of glibc. Not only is it more concise than '{ errno = err; return -1; }', it is since commit 6639cc10029e24e06b34e169712b21c31b8cf213 "hurd: Mark error functions as __COLD" marked with the cold attribute, telling the compiler that this codepath is unlikely to be executed. In one case, use __hurd_dfail () over the plain __hurd_fail (). Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230520115531.3911877-1-bugaevc@gmail.com>
2023-05-19powerpc:GCC(<10) doesn't allow -mlong-double-64 after -mabi=ieeelongdoubleMahesh Bodapati1-0/+17
Removed -mabi=ieeelongdouble on failing tests. It resolves the error. error: ‘-mabi=ieeelongdouble’ requires ‘-mlong-double-128’
2023-05-19hurd: Fix using interposable hurd_thread_selfSergey Bugaev6-5/+15
Create a private hidden __hurd_thread_self alias, and use that one. Fixes 2f8ecb58a59eb82c43214d000842d99644a662d1 "hurd: Fix x86_64 _hurd_tls_fork" and c7fcce38c83a2bb665ef5dc4981bf20c7e586123 "hurd: Make sure to not use tcb->self" Reported-by: Joseph Myers <joseph@codesourcery.com> Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-05-19hurd 64bit: Re-introduce gai_suspend symbolSamuel Thibault1-0/+2
4d3f846b88d3 ("hurd: Fix __TIMESIZE on x86_64") incidentaly dropped it because it fixed hurd 64bit into setting __TIMESIZE to 64, and that case was not having gai_suspend defined yet.
2023-05-19hurd: Fix __TIMESIZE on x86_64Sergey Bugaev2-1/+5
We had sizeof (time_t) == 8, but __TIMESIZE == 32. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230519171516.3698754-1-bugaevc@gmail.com>
2023-05-19posix: Reformat Makefile.Carlos O'Donell1-20/+20
Fix LOCALE list formatting. Sort all reflowed text using scripts/sort-makefile-lines.py. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
2023-05-19hurd: Fix expected c++ typesSamuel Thibault1-19/+19
90604f670c10 ("hurd 64bit: Add data for check-c++-types") actually added the 32bit version. This fixes it into a 64bit version.
2023-05-18catgets: Reformat Makefile.Carlos O'Donell1-10/+30
Reflow all long lines adding comment terminators. Sort all reflowed text using scripts/sort-makefile-lines.py. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
2023-05-18benchtests: Reformat Makefile.Carlos O'Donell1-15/+32
Reflow all long lines adding comment terminators. Sort all reflowed text using scripts/sort-makefile-lines.py. No regressions running microbenchmarks. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
2023-05-18assert: Reformat Makefile.Carlos O'Donell1-3/+14
Reflow all long lines adding comment terminators. Sort all reflowed text using scripts/sort-makefile-lines.py. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
2023-05-18nptl: Reformat Makefile.Carlos O'Donell5-79/+196
Reflow all long lines adding comment terminators. Rename files that cause inconsistent ordering. Sort all reflowed text using scripts/sort-makefile-lines.py. No code generation changes observed in binary artifacts. No regressions on x86_64 and i686.
2023-05-18wcsmbs: Reformat Makefile.Carlos O'Donell1-1/+1
Reflow Makefile. Sort using updated scripts/sort-makefile-lines.py. Code generation is changed as routines are linked in sorted order as expected. No regressions on x86_64 and i686. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-18misc: Reformat Makefile.Carlos O'Donell1-3/+3
Reflow Makefile. Sort using updated scripts/sort-makefile-lines.py. Code generation is changed as routines are linked in sorted order as expected. No regressions on x86_64 and i686. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-18stdio-common: Adjust tests in MakefileCarlos O'Donell6-22/+22
Sort tests against updated scripts/sort-makefile-lines.py. No changes in generated code. No regressions on x86_64 and i686. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-18elf: Adjust tests in Makefile.Carlos O'Donell1-10/+10
Sort tests against updated scripts/sort-makefile-lines.py. No changes in generated code. No regressions on x86_64 and i686. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-18scripts: sort-makefile-lines.pyCarlos O'Donell1-1/+4
We must return < 0, 0, or > 0 as the result of the comparison function for cmp_to_key() to work correctly across all comparisons. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-18Add a SECURITY.mdSiddhesh Poyarekar1-0/+209
Move content from the Security Process[1] and Security Exceptions[2] wiki documents into the repository so that it is in a standard place for analysis tools to look for the glibc security policy. This is a more or less verbatim port of the wiki document with some restructuring for a more coherent layout since the two pages are now merged. There should be no change in messaging in this commit. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-05-18Add HWCAP2_SME* from Linux 6.3 to AArch64 bits/hwcap.hJoseph Myers1-0/+6
Linux 6.3 adds six HWCAP2_SME* constants for AArch64; add them to the corresponding bits/hwcap.h in glibc. Tested with build-many-glibcs.py for aarch64-linux-gnu.
2023-05-17hurd: Also make it possible to call strlen very earlySergey Bugaev1-0/+3
strlen, which is another ifunc-selected function, is invoked during early static executable startup if the argv arrives from the exec server. Make it not crash. Checked on x86_64-gnu: statically linked executables launched after the exec server is up now start up successfully. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-10-bugaevc@gmail.com>
2023-05-17hurd: Fix setting up pthreadsSergey Bugaev2-1/+94
On x86_64, we have to pass function arguments in registers, not on the stack. We also have to align the stack pointer in a specific way. Since sharing the logic with i386 does not bring much benefit, split the file back into i386- and x86_64-specific versions, and fix the x86_64 version to set up the thread properly. Bonus: i386 keeps doing the extra RPC inside __thread_set_pcsptp to fetch the state of the thread before setting it; but x86_64 no lnoger does that. Checked on x86_64-gnu and i686-gnu. Fixes be6d002ca277ffc90058d382396150cb0e785b9c "hurd: Set up the basic tree for x86_64-gnu" Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-9-bugaevc@gmail.com>
2023-05-17hurd: Fix x86_64 _hurd_tls_forkSergey Bugaev1-6/+19
It is illegal to call thread_get_state () on mach_thread_self (), so this codepath cannot be used as-is to fork the calling thread's TLS. Fortunately we can use THREAD_SELF (aka %fs:0x0) to find out the value of our fs_base without calling into the kernel. Fixes: f6cf701efc61c9ad910372bda14b9a235db310a8 "hurd: Implement TLS for x86_64" Checked on x86_64-gnu: fork () now works! Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-8-bugaevc@gmail.com>
2023-05-17hurd: Make sure to not use tcb->selfSergey Bugaev3-26/+14
Unlike sigstate->thread, tcb->self did not hold a Mach port reference on the thread port it names. This means that the port can be deallocated, and the name reused for something else, without anyone noticing. Using tcb->self will then lead to port use-after-free. Fortunately nothing was accessing tcb->self, other than it being intially set to then-valid thread port name upon TCB initialization. To assert that this keeps being the case without altering TCB layout, rename self -> self_do_not_use, and stop initializing it. Also, do not (re-)allocate a whole separate and unused stack for the main thread, and just exit __pthread_setup early in this case. Found upon attempting to use tcb->self and getting unexpected crashes. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-7-bugaevc@gmail.com>
2023-05-17hurd: Use __mach_setup_thread_call ()Sergey Bugaev3-11/+15
...instead of mach_setup_thread (), which is unsuitable for setting up function calls. Checked on x86_64-gnu: the signal thread no longer crashes upon trying to process a message. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-6-bugaevc@gmail.com>
2023-05-17mach: Add __mach_setup_thread_call ()Sergey Bugaev3-16/+74
This is just like mach_setup_thread (), but it's suitable for making the thread call a function correctly, as opposed to explicitly setting the thread's stack and instruction pointers to the given values. Internally, it uses MACHINE_THREAD_STATE_SETUP_CALL. Unlike mach_setup_thread (), which is exported via mach.h for the benefit of the Hurd exec server, __mach_setup_thread_call () is private to glibc for the time being. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-5-bugaevc@gmail.com>
2023-05-17hurd: Use MACHINE_THREAD_STATE_SETUP_CALLSergey Bugaev1-2/+2
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-4-bugaevc@gmail.com>
2023-05-17mach: Define MACHINE_THREAD_STATE_SETUP_CALLSergey Bugaev2-0/+22
The existing two macros, MACHINE_THREAD_STATE_SET_PC and MACHINE_THREAD_STATE_SET_SP, can be used to set program counter and the stack pointer registers in a machine-specific thread state structure. Useful as it is, this may not be enough to set up the thread to make a function call, because the machine-specific ABI may impose additional requirements. In particular, x86_64 ABI requires that upon function entry, the stack pointer is 8 less than 16-byte aligned (sp & 15 == 8). To deal with this, introduce a new macro, MACHINE_THREAD_STATE_SETUP_CALL (), which sets both stack and instruction pointers, and also applies any machine-specific requirements to make a valid function call. The default implementation simply forwards to MACHINE_THREAD_STATE_SET_PC and MACHINE_THREAD_STATE_SET_SP, but on x86_64 we additionally align the stack pointer. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230517191436.73636-3-bugaevc@gmail.com>
2023-05-17Use TASK_THREAD_TIMES_INFO_COUNT when calling task_info with ↵Flavio Cruz1-1/+1
TASK_THREAD_TIMES_INFO This hasn't caused any problems yet but we are passing a pointer to struct task_thread_times_info which can cause problems if we populate over the existing size of the struct. Message-Id: <ZGRDDNcOM2hA3CuT@jupiter.tail36e24.ts.net>
2023-05-17argp: Reformat Makefile.Carlos O'Donell1-6/+24
Reflow Makefile. Sort using scripts/sort-makefile-lines.py. Code generation is changed as routines are linked in sorted order as expected. No regressions on x86_64 and i686.
2023-05-17stdlib: Avoid undefined behavior in stdlib/tst-labsFlorian Weimer1-12/+13
The last loop could attempt to overflow beyond INT_MAX on 32-bit architectures. Also switch to GNU style. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-17stdlib: Use long long int in stdlib/tst-llabsFlorian Weimer1-15/+15
And adjust for GNU style. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-05-16Update kernel version to 6.3 in header constant testsJoseph Myers3-4/+4
This patch updates the kernel version in the tests tst-mman-consts.py, tst-mount-consts.py and tst-pidfd-consts.py to 6.3. (There are no new constants covered by these tests in 6.3 that need any other header changes.) Tested with build-many-glibcs.py.
2023-05-16i386: Use pthread_barrier for synchronization on tst-bz21269DJ Delorie1-5/+28
So I was able to reproduce the hangs in the original source, and debug it, and fix it. In doing so, I realized that we can't use anything complex to trigger the thread because that "anything" might also cause the expected segfault and force everything out of sync again. Here's what I ended up with, and it doesn't seem to hang where the original one hung quite often (in a tight while..end loop). The key changes are: 1. Calls to futex are error checked, with retries, to ensure that the futexes are actually doing what they're supposed to be doing. In the original code, nearly every futex call returned an error. 2. The main loop has checks for whether the thread ran or not, and "unlocks" the thread if it didn't (this is how the original source hangs). Note: the usleep() is not for timing purposes, but just to give the kernel an excuse to run the other thread at that time. The test will not hang without it, but is more likely to test the right bugfix if the usleep() is present.
2023-05-16stdlib: Add testcases for llabs(). (BZ #30263)Joe Simmons-Talbott2-0/+57
Test minimum and maximum long long values, zero, 32bit crossover points, and part of the range of long long values. Use '-fno-builtin' to ensure we are testing the implementation. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-05-16stdlib: Add testcases for labs(). (BZ #30263)Joe Simmons-Talbott2-0/+53
Test minimum and maximum long values, zero, and part of the range of long values. Use '-fno-builtin' to ensure we are testing the implementation. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-05-16stdlib: Add testcases for abs(). (BZ #30263)Joe Simmons-Talbott2-0/+48
Test minimum and maximum int values, zero, and part of the range of int values. Use '-fno-builtin' to ensure we are testing the implementation. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-05-16hurd: Fix computing user stack pointerSergey Bugaev1-1/+1
Fixes b574ae0a2876ee94e4fe617f878407bf818c2df0 "hurd: Implement sigreturn for x86_64" Checked on x86_64-gnu. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230515083323.1358039-5-bugaevc@gmail.com>
2023-05-16hurd: Fix sc_i386_thread_state layoutSergey Bugaev2-0/+14
The real i386_thread_state Mach structure has an alignment of 8 on x86_64. However, in struct sigcontext, the compiler was packing sc_gs (which is the first member of sc_i386_thread_state) into the same 8-byte slot as sc_error; this resulted in the rest of sc_i386_thread_state members having wrong offsets relative to each other, and the overall sc_i386_thread_state layout mismatching that of i386_thread_state. Fix this by explicitly adding the required padding members, and statically asserting that this results in the desired alignment. The same goes for sc_i386_float_state. Checked on x86_64-gnu. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230515083323.1358039-4-bugaevc@gmail.com>
2023-05-16hurd: Align signal stack pointer after allocating stackframeSergey Bugaev1-3/+2
sizeof (*stackframe) appears to be divisible by 16, but we should not rely on that. So make sure to leave enough space for the stackframe first, and then align the final pointer at 16 bytes. Checked on x86_64-gnu. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230515083323.1358039-3-bugaevc@gmail.com>