about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* localedata: id_ID: change first weekday to SundayMike FABIAN2023-12-191-1/+1
| | | | | | | | | Resolves: BZ # 30412 See: https://sourceware.org/bugzilla/show_bug.cgi?id=30412#c7 CLDR also has ID in the list of territories which have Sunday as the first day of the week.
* s390: Set psw addr field in getcontext and friends.Stefan Liebler2023-12-196-0/+34
| | | | | | | | | | | | | | | | | | | | So far if the ucontext structure was obtained by getcontext and co, the return address was stored in general purpose register 14 as it is defined as return address in the ABI. In contrast, the context passed to a signal handler contains the address in psw.addr field. If somebody e.g. wants to dump the address of the context, the origin needs to be known. Now this patch adjusts getcontext and friends and stores the return address also in psw.addr field. Note that setcontext isn't adjusted and it is not supported to pass a ucontext structure from signal-handler to setcontext. We are not able to restore all registers and branching to psw.addr without clobbering one register.
* x86: Unifies 'strlen-evex' and 'strlen-evex512' implementations.Matthew Sterrett2023-12-185-472/+439
| | | | | | | | | | | | | | | | | | | | | | This commit uses a common implementation 'strlen-evex-base.S' for both 'strlen-evex' and 'strlen-evex512' The motivation is to reduce the number of implementations to maintain. This incidentally gives a small performance improvement. All tests pass on x86. Benchmarks were taken on SKX. https://www.intel.com/content/www/us/en/products/sku/123613/intel-core-i97900x-xseries-processor-13-75m-cache-up-to-4-30-ghz/specifications.html Geometric mean for strlen-evex512 over all benchmarks (N=10) was (new/old) 0.939 Geometric mean for wcslen-evex512 over all benchmarks (N=10) was (new/old) 0.965 Code Size Changes: strlen-evex512.S : +24 bytes wcslen-evex512.S : +54 bytes Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* x86/cet: Don't assume that SHSTK implies IBTH.J. Lu2023-12-183-11/+11
| | | | | | | Since shadow stack (SHSTK) is enabled in the Linux kernel without enabling indirect branch tracking (IBT), don't assume that SHSTK implies IBT. Use "CPU_FEATURE_ACTIVE (IBT)" to check if IBT is active and "CPU_FEATURE_ACTIVE (SHSTK)" to check if SHSTK is active.
* id_ID: Update Time LocalesRushingAlien2023-12-181-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hello! I am Indonesian, was born and raised in Indonesia and still do live in Indonesia. This patch brings a few changes to the time locales of id_ID, which includes : \- Defining am_pm and time_fmpt_ampm \- Changing time_fmt and d_t_fmt to use the 24-hour format \- Changing first_weekday to Monday This is a squashed version of what is previously a 5 patch set Here are reasons and details of the changes : Change 1 part 1 id_ID: Define `am_pm` string Current formatting does not define am_pm string, leading to AM and PM not being specified in 12 H time format. This change defines the string by changing it from an empty string to "AM";"PM". output of `date +%r`: before commit: 01:23 after commit: 01:23 PM Change 1 part 2 id_ID: Define time_fmt_ampm, change from an empty string Currently, time_fmpt_ampm is set to an empty string, causing some programs to not be able to display time in the 12-hour format, for example, glib: https://gitlab.gnome.org/GNOME/glib/-/issues/2967. This commit changes it from an empty string to "%I:%M:%S %p" Change 2 part 1 id_ID: Use 24-hour format for time_fmt Indonesian standard and formal time format uses the 24-hour format inst- ead of the 12-hour format. This commit aims to change the id_ID locale's time_fmt to match that accordingly. Change 2 part 2 id_ID: Use 24-hour format for d_t_fmt. Indonesian standard and formal time format uses the 24-hour format inst- ead of the 12-hour format. This commit aims to change the id_ID locale's d_t_fmt to match that accordingly. Change 3 id_ID: Change first_weekday to monday Indonesian calendar starts of the week with Monday, let's comply Message-ID: <20230821035530.9075-1-rushing27alien@gmail.com> Resolves: BZ # 30412 Reviewed-by: Mike Fabian <mfabian@redhat.com>
* Update code to handle the new ABI for sending inlined port rights.Flavio Cruz2023-12-172-5/+33
| | | | | For i686, this change is no op but for x86_64 it forces all inlined port rights to be 8 bytes long.
* x86/cet: Check user_shstk in /proc/cpuinfoH.J. Lu2023-12-171-1/+1
| | | | | Linux kernel reports CPU shadow stack feature in /proc/cpuinfo as user_shstk, instead of shstk.
* Add a test for setjmp/longjmp within user contextH.J. Lu2023-12-162-0/+179
| | | | | Verify that setjmp/longjmp works correctly within a user context. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* Add a test for longjmp from user contextH.J. Lu2023-12-162-0/+88
| | | | | | Verify that longjmp works correctly after setcontext is called to switch to a user context. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* powerpc: Add space for HWCAP3/HWCAP4 in the TCB for future Power.Manjunath Matti2023-12-157-1/+26
| | | | | | | | | | | | | | This patch reserves space for HWCAP3/HWCAP4 in the TCB of powerpc. These hardware capabilities bits will be used by future Power architectures. Versioned symbol '__parse_hwcap_3_4_and_convert_at_platform' advertises the availability of the new HWCAP3/HWCAP4 data in the TCB. This is an ABI change for GLIBC 2.39. Suggested-by: Peter Bergner <bergner@linux.ibm.com> Reviewed-by: Peter Bergner <bergner@linux.ibm.com>
* powerpc: Fix performance issues of strcmp power10Amrita H S2023-12-151-66/+95
| | | | | | | | | | | | | | | | | Current implementation of strcmp for power10 has performance regression for multiple small sizes and alignment combination. Most of these performance issues are fixed by this patch. The compare loop is unrolled and page crosses of unrolled loop is handled. Thanks to Paul E. Murphy for helping in fixing the performance issues. Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com> Co-Authored-By: Paul E. Murphy <murphyp@linux.ibm.com> Reviewed-by: Rajalakshmi Srinivasaraghavan <rajis@linux.ibm.com>
* localedata: Convert el_GR and el_CY locales to UTF-8Mike FABIAN2023-12-152-103/+103
|
* localedata: el_GR: Greece now uses the 24h format for timeMike FABIAN2023-12-151-4/+4
| | | | Resolves: BZ # 23012
* powerpc : Add optimized memchr for POWER10MAHESH BODAPATI2023-12-145-10/+367
| | | | | | Optimized memchr for POWER10 based on existing rawmemchr and strlen. Reordering instructions and loop unrolling helped in getting better performance. Reviewed-by: Rajalakshmi Srinivasaraghavan <rajis@linux.ibm.com>
* intl: Treat C.UTF-8 locale like C locale, part 2 (BZ# 16621)Bruno Haible2023-12-121-3/+4
| | | | | | | | | | | The previous commit was incomplete: gettext() still returns a translation if the file /usr/share/locale/C/LC_MESSAGES/<domain>.mo exists. This patch prohibits the translation also in this case. * gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Treat C.<encoding> locale like the C locale. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* resolv: Fix a few unaligned accesses to fields in HEADERLudwig Rydberg2023-12-122-6/+6
| | | | | | | | | | | | | | | | | | | | | | After refactoring the alloca usage in 40c0add7d4 ("resolve: Remove __res_context_query alloca usage") a few unaligned accesses to HEADER fields surfaced. These unaligned accesses led to problems when running the resolv test suite on sparc32-linux (leon) as many tests failed due to SIGBUS crashes. The issue(s) occured during T_QUERY_A_AND_AAAA queries as the second query now can start on an unaligned address (previously it was explicitly aligned). With this patch the unaligned accesses are now fixed by using the UHEADER instead to ensure the fields are accessed with byte loads/stores. The patch has been verfied by running the resolv test suite on sparc32 and x86_64. Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com> Signed-off-by: Andreas Larsson <andreas@gaisler.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* x86: Check PT_GNU_PROPERTY earlyH.J. Lu2023-12-111-40/+80
| | | | | | | The PT_GNU_PROPERTY segment is scanned before PT_NOTE. For binaries with the PT_GNU_PROPERTY segment, we can check it to avoid scan of the PT_NOTE segment. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* sysdeps/x86/Makefile: Split and sort testsH.J. Lu2023-12-111-32/+78
| | | | Put each test on a separate line and sort tests.
* elf: Initialize GLRO(dl_lazy) before relocating libc in dynamic startupFlorian Weimer2023-12-081-3/+3
| | | | | | | | | | | GLRO(dl_lazy) is used to set the parameters for the early _dl_relocate_object call, so the consider_profiling setting has to be applied before the call. Fixes commit 78ca44da0160a0b442f0ca1f253e3360f044b2ec ("elf: Relocate libc.so early during startup and dlmopen (bug 31083)"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Move CVE information into advisories directorySiddhesh Poyarekar2023-12-077-19/+126
| | | | | | | | | | | | | | | | | | | One of the requirements to becoming a CVE Numbering Authority (CNA) is to publish advisories. Do this by maintaining a file for each CVE fixed in the advisories directory in the source tree. Links to the advisories can then be shared as: https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=advisories/GLIBC-SA-YYYY-NNNN The file format at the moment is rudimentary and derives from the git commit format, i.e. a subject line and a potentially multi-paragraph description and then tags to describe some meta information. This is a loose format at the moment and could change as we evolve this. Also add a script process-fixed-cves.sh that processes these advisories and generates a list to add to NEWS at release time. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* powerpc: Optimized strcmp for power10Amrita H S2023-12-075-1/+240
| | | | | | | | | | | | | | | | | | | This patch is based on __strcmp_power9 and __strlen_power10. Improvements from __strcmp_power9: 1. Uses new POWER10 instructions - This code uses lxvp to decrease contention on load by loading 32 bytes per instruction. 2. Performance implication - This version has around 30% better performance on average. - Performance regression is seen for a specific combination of sizes and alignments. Some of them is observed without changes also, while rest may be induced by the patch. Signed-off-by: Amrita H S <amritahs@linux.vnet.ibm.com> Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
* elf: Fix wrong break removal from 8ee878592cAdhemerval Zanella2023-12-071-0/+1
| | | | Reported-by: Alexander Monakov <amonakov@ispras.ru>
* localedata: Convert day names in nn_NO locale to UTF-8Mike FABIAN2023-12-071-2/+2
|
* localedata: Remove trailing whitespace in weekday names in nn_NO localeMike FABIAN2023-12-071-7/+7
| | | | Resolves: BZ # 25868
* elf: Refactor process_envvarsAdhemerval Zanella2023-12-051-48/+84
| | | | | | | | | | It splits between process_envvars_secure and process_envvars_default, with the former used to process arguments for __libc_enable_secure. It does not have any semantic change, just simplify the code so there is no need to handle __libc_enable_secure on each len switch. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Ignore LD_BIND_NOW and LD_BIND_NOT for setuid binariesAdhemerval Zanella2023-12-053-4/+10
| | | | | | | | To avoid any environment variable to change setuid binaries semantics. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Ignore loader debug env vars for setuidAdhemerval Zanella2023-12-053-8/+20
| | | | | | | | | | | | | Loader already ignores LD_DEBUG, LD_DEBUG_OUTPUT, and LD_TRACE_LOADED_OBJECTS. Both LD_WARN and LD_VERBOSE are similar to LD_DEBUG, in the sense they enable additional checks and debug information, so it makes sense to disable them. Also add both LD_VERBOSE and LD_WARN on filtered environment variables for setuid binaries. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Adapt the security policy for the security pageSiddhesh Poyarekar2023-12-051-47/+14
| | | | | | | | Call the document a "Security Policy" to disambiguate it from the security *process* documented in the security page. Also, point to the security page for bug reporting and CVE assignment. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* aarch64: correct CFI in rawmemchr (bug 31113)Andreas Schwab2023-12-051-1/+1
| | | | | | | The .cfi_return_column directive changes the return column for the whole FDE range. But the actual intent is to tell the unwinder that the value in x30 (lr) now resides in x15 after the move, and that is expressed by the .cfi_register directive.
* math: Add new exp10 implementationJoe Ramsay2023-12-043-24/+135
| | | | | | | | | | | | | | | | | | | | | | | New implementation is based on the existing exp/exp2, with different reduction constants and polynomial. Worst-case error in round-to- nearest is 0.513 ULP. The exp/exp2 shared table is reused for exp10 - .rodata size of e_exp_data increases by 64 bytes. As for exp/exp2, targets with single-instruction rounding/conversion intrinsics can use them by toggling TOINT_INTRINSICS=1 and adding the necessary code to their math_private.h. Improvements on Neoverse V1 compared to current GLIBC master: exp10 thruput: 3.3x in [-0x1.439b746e36b52p+8 0x1.34413509f79ffp+8] exp10 latency: 1.8x in [-0x1.439b746e36b52p+8 0x1.34413509f79ffp+8] Tested on: aarch64-linux-gnu (TOINT_INTRINSICS, fma contraction) and x86_64-linux-gnu (!TOINT_INTRINSICS, no fma contraction) Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64: fix tested ifunc variantsSzabolcs Nagy2023-12-041-3/+3
| | | | | Don't test a64fx string functions when BTI is enabled since they are not BTI compatible.
* stdlib: Fix array bounds protection in insertion sort phase of qsortFlorian Weimer2023-12-043-1/+62
| | | | | | | | | | The previous check did not do anything because tmp_ptr already points before run_ptr due to the way it is initialized. Fixes commit e4d8117b82065dc72e8df80097360e7c05a349b9 ("stdlib: Avoid another self-comparison in qsort"). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Revert "Update code to handle the new ABI for sending inlined port rights."Samuel Thibault2023-12-032-33/+5
| | | | This reverts commit 7e23b3c2c008e0b9b5da055e675d40cc27bb10ef.
* Revert "hurd: Fix build"Samuel Thibault2023-12-031-1/+1
| | | | This reverts commit 7096914dd8ff2dfd1d8cba3577b72838f5e4c2bd.
* hurd: Fix buildSamuel Thibault2023-12-031-1/+1
| | | | | | | 7e23b3c2c008 ("Update code to handle the new ABI for sending inlined port rights.") was missing a cast. Fixes 7e23b3c2c008e0b9b5da055e675d40cc27bb10ef
* Update code to handle the new ABI for sending inlined port rights.Flavio Cruz2023-12-032-5/+33
| | | | | | For i686, this change is no op but for x86_64 it forces all inlined port rights to be 8 bytes long. Message-ID: <20231124213041.952886-2-flaviocruz@gmail.com>
* hurd: [!__USE_MISC] Do not #undef BSD macros in ioctlsSamuel Thibault2023-12-021-0/+2
| | | | | When e.g. including termios.h first and then sys/ioctl.h, without e.g. _BSD_SOURCE, the latter would #undef e.g. ECHO, without defining it.
* linux: Make fdopendir fail with O_PATH (BZ 30373)Adhemerval Zanella2023-11-303-1/+56
| | | | | | | | | It is not strictly required by the POSIX, since O_PATH is a Linux extension, but it is QoI to fail early instead of at readdir. Also the check is free, since fdopendir already checks if the file descriptor is opened for read. Checked on x86_64-linux-gnu.
* Avoid padding in _init and _fini. [BZ #31042]Stefan Liebler2023-11-302-3/+1
| | | | | | | | | | | | | | | | | | | | | The linker just concatenates the .init and .fini sections which results in the complete _init and _fini functions. If needed the linker adds padding bytes due to an alignment. GNU ld is adding NOPs, which is fine. But e.g. mold is adding traps which results in broken _init and _fini functions. Thus this patch removes the alignment in .init and .fini sections in crtn.S files. We keep the 4 byte function alignment in crti.S files. As the assembler now also outputs the start of _init and _fini functions as multiples of 4 byte, it perhaps has to fill it. Although GNU as is using NOPs here, to be sure, we just keep the alignment with 0x07 (=NOPs) at the end of crti.S. In order to avoid an obvious NOP slide in _fini, this patch also uses an lg instead of lgr instruction. Then the emitted instructions needs a multiple of 4 bytes.
* aarch64: Improve special-case handling in AdvSIMD double-precision libmvec ↵Joe Ramsay2023-11-291-1/+7
| | | | | | | routines Avoids emitting many saves/restores of vector registers, reduces the amount of code generated around the scalar fallback.
* malloc: Improve MAP_HUGETLB with glibc.malloc.hugetlb=2Adhemerval Zanella2023-11-291-3/+10
| | | | | | | | | | | | | | | | Even for explicit large page support, allocation might use mmap without the hugepage bit set if the requested size is smaller than mmap_threshold. For this case where mmap is issued, MAP_HUGETLB is set iff the allocation size is larger than the used large page. To force such allocations to use large pages, also tune the mmap_threhold (if it is not explicit set by a tunable). This forces allocation to follow the sbrk path, which will fall back to mmap (which will try large pages before galling back to default mmap). Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com> Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
* elf: Add a way to check if tunable is set (BZ 27069)Adhemerval Zanella2023-11-296-2/+73
| | | | | | | | | | | The patch adds two new macros, TUNABLE_GET_DEFAULT and TUNABLE_IS_INITIALIZED, here the former get the default value with a signature similar to TUNABLE_GET, while the later returns whether the tunable was set by the environment variable. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com> Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
* x86: Only align destination to 1x VEC_SIZE in memset 4x loopNoah Goldstein2023-11-281-1/+1
| | | | | | | | | Current code aligns to 2x VEC_SIZE. Aligning to 2x has no affect on performance other than potentially resulting in an additional iteration of the loop. 1x maintains aligned stores (the only reason to align in this case) and doesn't incur any unnecessary loop iterations. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
* elf: Fix TLS modid reuse generation assignment (BZ 29039)Hector Martin2023-11-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _dl_assign_tls_modid() assigns a slotinfo entry for a new module, but does *not* do anything to the generation counter. The first time this happens, the generation is zero and map_generation() returns the current generation to be used during relocation processing. However, if a slotinfo entry is later reused, it will already have a generation assigned. If this generation has fallen behind the current global max generation, then this causes an obsolete generation to be assigned during relocation processing, as map_generation() returns this generation if nonzero. _dl_add_to_slotinfo() eventually resets the generation, but by then it is too late. This causes DTV updates to be skipped, leading to NULL or broken TLS slot pointers and segfaults. Fix this by resetting the generation to zero in _dl_assign_tls_modid(), so it behaves the same as the first time a slot is assigned. _dl_add_to_slotinfo() will still assign the correct static generation later during module load, but relocation processing will no longer use an obsolete generation. Note that slotinfo entry (aka modid) reuse typically happens after a dlclose and only TLS access via dynamic tlsdesc is affected. Because tlsdesc is optimized to use the optional part of static TLS, dynamic tlsdesc can be avoided by increasing the glibc.rtld.optional_static_tls tunable to a large enough value, or by LD_PRELOAD-ing the affected modules. Fixes bug 29039. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
* Add TCP_MD5SIG_FLAG_IFINDEX from Linux 5.6 to netinet/tcp.h.Tobias Klauser2023-11-281-1/+2
| | | | | | | | This patch adds the TCP_MD5SIG_FLAG_IFINDEX constant from Linux 5.6 to sysdeps/gnu/netinet/tcp.h and updates struct tcp_md5sig accordingly to contain the device index. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* elf: Relocate libc.so early during startup and dlmopen (bug 31083)Florian Weimer2023-11-277-2/+118
| | | | | | | This makes it more likely that objects without dependencies can use IFUNC resolvers in libc.so. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* elf: Introduce the _dl_open_relocate_one_object functionFlorian Weimer2023-11-271-39/+47
| | | | | | It is extracted from dl_open_worker_begin. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* elf: In _dl_relocate_object, skip processing if object is relocatedFlorian Weimer2023-11-271-3/+3
| | | | | | | This is just a minor optimization. It also makes it more obvious that _dl_relocate_object can be called multiple times. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Remove __access_noerrnoJoseph Myers2023-11-239-71/+5
| | | | | | | | | | | | | | | | A recent commit, apparently commit 6c6fce572fb8f583f14d898e54fd7d25ae91cf56 "elf: Remove /etc/suid-debug support", resulted in localplt failures for i686-gnu and x86_64-gnu: Missing required PLT reference: ld.so: __access_noerrno After that commit, __access_noerrno is actually no longer used at all. So rather than just removing the localplt expectation for that symbol for Hurd, completely remove all definitions of and references to that symbol. Tested for x86_64, and with build-many-glibcs.py for i686-gnu and x86_64-gnu.
* malloc: Use __get_nprocs on arena_get2 (BZ 30945)Adhemerval Zanella2023-11-225-18/+2
| | | | | | | | | | | | | | | | This restore the 2.33 semantic for arena_get2. It was changed by 11a02b035b46 to avoid arena_get2 call malloc (back when __get_nproc was refactored to use an scratch_buffer - 903bc7dcc2acafc). The __get_nproc was refactored over then and now it also avoid to call malloc. The 11a02b035b46 did not take in consideration any performance implication, which should have been discussed properly. The __get_nprocs_sched is still used as a fallback mechanism if procfs and sysfs is not acessible. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com>