aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-23Update syscall lists for Linux 5.17Joseph Myers27-2/+29
Linux 5.17 has one new syscall, set_mempolicy_home_node. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
2022-03-23Fix ununsed fstatat64_time64_statxAdhemerval Zanella1-5/+5
It is only called for legacy ABIs.
2022-03-23malloc: Fix duplicate inline for do_set_mxfastAdhemerval Zanella1-2/+1
2022-03-23elf: Remove inline _dl_dprintfAdhemerval Zanella1-11/+0
It is not used on rtld and ldsodef interfaces are meant to be used solely on loader. It also removes the only usage of gcc extension __builtin_va_arg_pack.
2022-03-22configure.ac: fix bashisms in configure.acSam James6-6/+6
configure scripts need to be runnable with a POSIX-compliant /bin/sh. On many (but not all!) systems, /bin/sh is provided by Bash, so errors like this aren't spotted. Notably Debian defaults to /bin/sh provided by dash which doesn't tolerate such bashisms as '=='. This retains compatibility with bash. Fixes configure warnings/errors like: ``` checking if compiler warns about alias for function with incompatible types... yes /var/tmp/portage/sys-libs/glibc-2.34-r10/work/glibc-2.34/configure: 4209: test: xyes: unexpected operator ``` Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Sam James <sam@gentoo.org>
2022-03-23getaddrinfo: Refactor code for readabilitySiddhesh Poyarekar1-12/+33
The close_retry goto jump is confusing and clumsy to read, so refactor the code a bit to make it easier to follow. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22Use Linux 5.17 in build-many-glibcs.pyJoseph Myers1-1/+1
This patch makes build-many-glibcs.py use Linux 5.17. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
2022-03-22resolv: Fix unaligned accesses to fields in HEADER structJohn David Anglin3-14/+21
The structure HEADER is normally aligned to a word boundary but sometimes it needs to be accessed when aligned on a byte boundary. This change defines a new typedef, UHEADER, with alignment 1. It is used to ensure the fields are accessed with byte loads and stores when necessary. V4: Change to res_mkquery.c deleted. Small whitespace fix. V5: Move UHEADER typedef to resolv/resolv-internal.h. Replace all HEADER usage with UHEADER in resolv/res_send.c. Signed-off-by: John David Anglin <dave.anglin@bell.net> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-22gai_init: Avoid jumping from if condition to its else counterpartSiddhesh Poyarekar1-250/+248
Clean up another antipattern where code flows from an if condition to its else counterpart with a goto. Most of the change in this patch is whitespace-only; a `git diff -b` ought to show the actual logic changes. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaiconf_init: Refactor some bits for readabilitySiddhesh Poyarekar1-65/+84
Split out line processing for `label`, `precedence` and `scopev4` into separate functions instead of the gotos. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gethosts: Return EAI_MEMORY on allocation failureSiddhesh Poyarekar1-2/+2
All other cases of failures due to lack of memory return EAI_MEMORY, so it seems wrong to return EAI_SYSTEM here. The only reason convert_hostent_to_gaih_addrtuple could fail is on calloc failure. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: Split result generation into its own functionSiddhesh Poyarekar1-90/+86
Simplify the loop a wee bit and clean up variable names too. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: split loopback lookup into its own functionSiddhesh Poyarekar1-65/+62
Flatten the condition nesting and replace the alloca for RET.AT/ATR with a single array LOCAL_AT[2]. This gets rid of alloca and alloca accounting. `git diff -b` is probably the best way to view this change since much of the diff is whitespace changes. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: make gethosts into a functionSiddhesh Poyarekar1-58/+59
The macro is quite a pain to debug, so make gethosts into a function to make it easier to maintain. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: separate nss lookup loop into its own functionSiddhesh Poyarekar1-277/+286
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: Split nscd lookup code into its own function.Siddhesh Poyarekar1-114/+134
Add a new member got_ipv6 to indicate if the results have an IPv6 result and use it instead of the local got_ipv6. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: Split simple gethostbyname into its own functionSiddhesh Poyarekar1-63/+64
Add a free_at flag in gaih_result to indicate if res.at needs to be freed by the caller. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: make numeric lookup a separate routineSiddhesh Poyarekar1-439/+452
Introduce the gaih_result structure and general paradigm for cleanups that follow to process the lookup request and return a result. A lookup function (like text_to_binary_address), should return an integer error code and set members of gaih_result based on what it finds. If the function does not have a result and no errors have occurred during the lookup, it should return 0 and res.at should be set to NULL, allowing a subsequent function to do the lookup until we run out of options. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: Simplify service resolutionSiddhesh Poyarekar1-100/+78
Refactor the code to split out the service resolution code into a separate function. Allocate the service tuples array just once to the size of the typeproto array, thus avoiding the unnecessary pointer chasing and stack allocations. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22getaddrinfo: Fix leak with AI_ALL [BZ #28852]Siddhesh Poyarekar1-9/+25
Use realloc in convert_hostent_to_gaih_addrtuple and fix up pointers in the result list so that a single block is maintained for hostbyname3_r/hostbyname2_r and freed in gaih_inet. This result is never merged with any other results, since the hosts database does not permit merging. Resolves BZ #28852. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22gaih_inet: Simplify canon name resolutionSiddhesh Poyarekar1-55/+75
Simplify logic for allocation of canon to remove the canonbuf variable; canon now always points to an allocated block. Also pull the canon name set into a separate function. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-22Simplify allocations and fix merge and continue actions [BZ #28931]Siddhesh Poyarekar5-52/+750
Allocations for address tuples is currently a bit confusing because of the pointer chasing through PAT, making it hard to observe the sequence in which allocations have been made. Narrow scope of the pointer chasing through PAT so that it is only used where necessary. This also tightens actions behaviour with the hosts database in getaddrinfo to comply with the manual text. The "continue" action discards previous results and the "merge" action results in an immedate lookup failure. Consequently, chaining of allocations across modules is no longer necessary, thus opening up cleanup opportunities. A test has been added that checks some combinations to ensure that they work correctly. Resolves: BZ #28931 Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-21iconv: Add UTF-7-IMAP variant in utf-7.cMax Gautier5-6/+62
UTF-7-IMAP differs from UTF-7 in the followings ways (see RFC 3501[1] for reference) : - The shift character is '&' instead of '+' - There is no "optional direct characters" and the "direct characters" set is different - There is no implicit shift back to US-ASCII from BASE64, all BASE64 sequences MUST be terminated with '-' [1]: https://datatracker.ietf.org/doc/html/rfc3501#section-5.1.3 Signed-off-by: Max Gautier <mg@max.gautier.name> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-21iconv: make utf-7.c able to use variantsMax Gautier1-62/+172
Add infrastructure in utf-7.c to handle variants. The approach comes from iso646.c The variant is defined at gconv_init time and is passed as a supplementary variable. Signed-off-by: Max Gautier <mg@max.gautier.name> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-21iconv: Better mapping to RFC for UTF-7Max Gautier1-29/+31
- Direct use of characters instead of arcane arrays - isxbase64 is not the Modified BASE64 alphabet, but the characters who needs to trigger an explicit shift back to US-ASCII. Make that clearer Signed-off-by: Max Gautier <mg@max.gautier.name> Reviewed-by: Adhemerval Zanellla <adhemerval.zanella@linaro.org>
2022-03-21iconv: Always encode "optional direct" UTF-7 charactersMax Gautier1-10/+2
Signed-off-by: Max Gautier <mg@max.gautier.name> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-18stdio-common: Add wide stream coverage to tst-vfprintf-user-typeFlorian Weimer1-27/+93
And use TEST_COMPARE_STRING for the narrow tests. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-18libio: Flush-only _IO_str_overflow must not return EOF (bug 28949)Florian Weimer2-2/+8
In general, _IO_str_overflow returns the character passed as an argument on success. However, if flush-only operation is requested by passing EOF, returning EOF looks like an error, and the caller cannot tell whether the operation was successful or not. _IO_wstr_overflow had the same bug regarding WEOF. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-18libio: Convert tst_swprintf to the test frameworkFlorian Weimer1-51/+28
And increase test coverage slightly. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-18scripts/dso-ordering-test.py: Fix C&P error in * callrefs processingFlorian Weimer1-3/+3
The elf/dso-sort-tests-src subdirectory is not changed by this commit, so it seems that the cut-and-paste error was not material. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-03-17stdio-common: Generate ja_JP.EUC-JP localeFlorian Weimer1-0/+1
It is needed by tst-swprintf.
2022-03-17stdio-common: Re-flow and sort Makefile variablesFlorian Weimer1-66/+217
2022-03-17nss: Sort tests and tests-container and put one test per lineSiddhesh Poyarekar1-15/+24
Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-16benchtests: Use "=" instead of ":=" [BZ #28970]H.J. Lu1-2/+4
Use "=" instead of ":=" to allow sysdeps Makefiles to add more benches to bench and benchset. This fixes BZ #28970. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com>
2022-03-15hppa: Use END instead of PSEUDO_END in swapcontext.SJohn David Anglin1-1/+1
2022-03-15hppa: Implement swapcontext in assembler (bug 28960)John David Anglin2-82/+72
When swapcontext.c is compiled without -g, the following error occurs: Error: CFI instruction used without previous .cfi_startproc Fix by converting swapcontext routine to assembler.
2022-03-14associate a deallocator for iconv_openSteve Grubb1-7/+8
This patch associates iconv_close as a deallocator for iconv_open. This required moving the iconv_close declaration above iconv_open. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-14associate a deallocation for opendirSteve Grubb1-9/+11
This patch associates closedir as a deallocation for opendir and fdopendir. This required moving the closedir declaration above the other 2 functions. Reviewed-by: Paul Eggert <eggert@cs.ucla.edu> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-14Add access function attributes to epoll_waitSteve Grubb1-4/+8
This patch adds write access function attributes to the epoll_wait family of functions Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-14Add access function attributes to grp and shadow headersSteve Grubb3-12/+24
This patch adds access function attributes to the re-entrant functions in grp.h and shadow headers. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-14Define ISO 639-3 "tok" [BZ #28950]Carlos O'Donell1-0/+1
Effective 2022-01-20 via SIL request 2021-043 the identifier "tok" is now active for Toki Pona in the code set for ISO 639-3. References: https://iso639-3.sil.org/code/tok https://iso639-3.sil.org/sites/iso639-3/files/change_requests/2021/2021-043.pdf No regressions on x86_64.
2022-03-11nss: Protect against errno changes in function lookup (bug 28953)Florian Weimer4-4/+142
dlopen may clobber errno. The nss_test_errno module uses an ELF constructor to achieve that, but there could be internal errors during dlopen that cause this, too. Therefore, the NSS framework has to guard against such errno clobbers. __nss_module_get_function is currently the only function that calls __nss_module_load, so it is sufficient to save and restore errno around this call. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-03-11nss: Do not mention NSS test modules in <gnu/lib-names.h>Florian Weimer2-13/+5
They are not actually installed. Use the nss_files version instead in nss/Makefile, similar to how __nss_shlib_revision is derived from LIBNSS_FILES_SO. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-03-10malloc: Exit early on test failure in tst-reallocFlorian Weimer1-31/+15
This addresses more (correct) use-after-free warnings reported by GCC 12 on some targets. Fixes commit c094c232eb3246154265bb035182f92fe1b17ab8 ("Avoid -Wuse-after-free in tests [BZ #26779]."). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-10Add some missing access function attributesSteve Grubb2-11/+17
This patch adds some missing access function attributes to getrandom / getentropy and several functions in sys/xattr.h Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-03-08libio: Ensure output buffer for wchars (bug #28828)José Bollo4-2/+36
The _IO_wfile_overflow does not check if the write pointer for wide data is valid before access, different than _IO_file_overflow. This leads to crash on some cases, as described by bug 28828. The minimal sequence to produce the crash was: #include <stdio.h> #include <wchar.h> int main (int ac, char **av) { setvbuf (stdout, NULL, _IOLBF, 0); fgetwc (stdin); fputwc (10, stdout); /*CRASH HERE!*/ return 0; } The "fgetwc(stdin);" is necessary since it triggers the bug by setting the flag _IO_CURRENTLY_PUTTING on stdout indirectly (file wfileops.c, function _IO_wfile_underflow, line 213). Signed-off-by: Jose Bollo <jobol@nonadev.net>
2022-03-08inet: Return EAI_MEMORY when nrl_domainname() fails to allocate memoryAdhemerval Zanella1-68/+74
It aligns NI_NOFQDN with default behavior for getnameinfo(). Checked on x86_64-linux-gnu.
2022-03-08inet: Remove strdupa from nrl_domainname()Adhemerval Zanella1-5/+5
We can use the already in place scratch_buffer. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-08inet: Fix getnameinfo (NI_NOFQDN) race condition (BZ#28566)Adhemerval Zanella1-70/+78
The 'not_first' is accessed on nrl_domainname() in a non atomically way, although it is only updated after the lock is taken. This patch fix the double-checked locking by using acquire-release atomic operation instead of plain load and by moving the 'not_first' store only after 'domain' is actually set. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com>
2022-03-08benchtests: make compare_strings.py accept string as attribute valueSu Lifan1-1/+6
Commit ac759b1fbf28a82d99afde9046f8b72c7cba5dae added attribute "overlap" to bench-memmove-walk, whose value is a string. This change makes compare_strings.py fail since benchout_strings.schema.json requires the values of attributes to be number. This patch relaxes such constraint. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>