aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-10-16Add SCM_SECURITY, SCM_PIDFD to bits/socket.hJoseph Myers1-0/+4
Linux 6.5 adds a constant SCM_PIDFD (recall that the non-uapi linux/socket.h, where this constant is added, is in fact a header providing many constants that are part of the kernel/userspace interface). This shows up that SCM_SECURITY, from the same set of definitions and added in Linux 2.6.17, is also missing from glibc, although glibc has the first two constants from this set, SCM_RIGHTS and SCM_CREDENTIALS; add both missing constants to glibc. Tested for x86_64.
2023-10-16Add AT_HANDLE_FID from Linux 6.5 to bits/fcntl-linux.hJoseph Myers1-0/+11
Linux 6.5 adds a constant AT_HANDLE_FID; add it to glibc. Because this is a flag for the function name_to_handle_at declared in bits/fcntl-linux.h, put the flag there rather than alongside other AT_* flags in (OS-independent) fcntl.h. Tested for x86_64.
2023-10-16Avoid maybe-uninitialized warning in __kernel_rem_pio2Andreas Schwab1-9/+5
With GCC 14 on 32-bit x86 the compiler emits a maybe-uninitialized warning: ../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function '__kernel_rem_pio2': ../sysdeps/ieee754/dbl-64/k_rem_pio2.c:364:20: error: 'fq' may be used uninitialized [-Werror=maybe-uninitialized] 364 | y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; | ~~^~~ This is similar to the warning that is suppressed in the other branch of the switch. Help the compiler knowing that the variable is always initialized, which also makes the suppression obsolete.
2023-10-16Fix WAIT_FOR_DEBUGGER for container tests.Stefan Liebler1-8/+6
For container tests, gdb needs to set the sysroot to the corresponding testroot.root directory. The assumption was that PIDs < 3 means that we are running within a container. Starting with commit 2fe64148a81f0d78050c302f34a6853d21f7cae4 "Allow for unpriviledged nested containers", the default is to use the PID namespace of the parent. Thus support_test_main.c does not recognize our container anymore. This patch now assumes that we are running inside a container if test-container.c has set PID_OUTSIDE_CONTAINER and always uses this PID independent of having a new PID namespace or not. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-10-12stdlib: fix grouping verification with multi-byte thousands separator (bug ↵Andreas Schwab2-24/+13
30964) The grouping verification only worked for a single-byte thousands separator. With a multi-byte separator it returned as if no separators were present. The actual parsing in str_to_mpn will then go wrong when there are multiple adjacent multi-byte separators in the number.
2023-10-09build-many-glibcs: Check for required system toolsDJ Delorie1-0/+96
Notes for future devs: * Add tools as you find they're needed, with version 0,0 * Bump version when you find an old tool that doesn't work * Don't add a version just because you know it works Co-authored-by: Lukasz Majewski <lukma@denx.de> Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
2023-10-06x86: Prepare `strrchr-evex` and `strrchr-evex512` for AVX10Noah Goldstein3-569/+293
This commit refactors `strrchr-evex` and `strrchr-evex512` to use a common implementation: `strrchr-evex-base.S`. The motivation is `strrchr-evex` needed to be refactored to not use 64-bit masked registers in preperation for AVX10. Once vec-width masked register combining was removed, the EVEX and EVEX512 implementations can easily be implemented in the same file without any major overhead. The net result is performance improvements (measured on TGL) for both `strrchr-evex` and `strrchr-evex512`. Although, note there are some regressions in the test suite and it may be many of the cases that make the total-geomean of improvement/regression across bench-strrchr are cold. The point of the performance measurement is to show there are no major regressions, but the primary motivation is preperation for AVX10. Benchmarks where taken on TGL: https://www.intel.com/content/www/us/en/products/sku/213799/intel-core-i711850h-processor-24m-cache-up-to-4-80-ghz/specifications.html EVEX geometric_mean(N=5) of all benchmarks New / Original : 0.74 EVEX512 geometric_mean(N=5) of all benchmarks New / Original: 0.87 Full check passes on x86.
2023-10-05aarch64: Optimise vecmath logsJoe Ramsay7-215/+226
* Transpose table layout for improved memory access * Use half-vector special comparisons for AdvSIMD * Improve register use near special-case branches - Due to the presence of a function call, return value would get mov-d out of x0 in order to facilitate PCS. By moving the final computation after the branch this can be avoided Also change SVE routines to use overloaded intrinsics for readability.
2023-10-05aarch64: Cosmetic change in SVE exp routinesJoe Ramsay2-47/+44
Use overloaded intrinsics for readability. Codegen does not change, however while we're bringing the routines up-to-date with recent improvements to other routines in AOR it is worth copying this change over as well.
2023-10-05aarch64: Optimize SVE cos & cosfJoe Ramsay2-53/+47
Saves a mov by ensuring return value does not need to be moved out of the way before special-case branch. Also change to use overloaded intrinsics.
2023-10-05aarch64: Improve vecmath sin routinesJoe Ramsay3-73/+87
* Update ULP comment reflecting a new observed max in [-pi/2, pi/2] * Use the same polynomial in AdvSIMD and SVE, rather than FTRIG instructions * Improve register use near special-case branch Also use overloaded intrinsics for SVE.
2023-10-04nss: Get rid of alloca usage in makedb's write_output.Joe Simmons-Talbott1-1/+12
Replace alloca usage with a scratch_buffer. Reviewed-by: Arjun Shankar <arjun@redhat.com>
2023-10-04debug: Add regression tests for BZ 30932Adhemerval Zanella2-0/+84
Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-10-04Fix FORTIFY_SOURCE false positiveVolker Weißmann1-1/+3
When -D_FORTIFY_SOURCE=2 was given during compilation, sprintf and similar functions will check if their first argument is in read-only memory and exit with *** %n in writable segment detected *** otherwise. To check if the memory is read-only, glibc reads frpm the file "/proc/self/maps". If opening this file fails due to too many open files (EMFILE), glibc will now ignore this error. Fixes [BZ #30932] Signed-off-by: Volker Weißmann <volker.weissmann@gmx.de> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-10-04nss: Rearrange and sort Makefile variablesArjun Shankar1-14/+41
Rearrange lists of routines, tests, etc. into one-per-line in nss/Makefile and sort them using scripts/sort-makefile-lines.py. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-10-04inet: Rearrange and sort Makefile variablesArjun Shankar1-30/+112
Rearrange lists of routines, tests, etc. into one-per-line in inet/Makefile and sort them using scripts/sort-makefile-lines.py. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-10-04Fix off-by-one OOB write in iconv/tst-iconv-mtSzabolcs Nagy1-10/+5
The iconv buffer sizes must not include the \0 string terminator. And the output termination with *outbufpos = '\0' was OOB. Consistently use non-null-terminated buffer sizes. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-10-02tunables: Terminate if end of input is reached (CVE-2023-4911)Siddhesh Poyarekar3-15/+44
The string parsing routine may end up writing beyond bounds of tunestr if the input tunable string is malformed, of the form name=name=val. This gets processed twice, first as name=name=val and next as name=val, resulting in tunestr being name=name=val:name=val, thus overflowing tunestr. Terminate the parsing loop at the first instance itself so that tunestr does not overflow. This also fixes up tst-env-setuid-tunables to actually handle failures correct and add new tests to validate the fix for this CVE. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-10-02Propagate GLIBC_TUNABLES in setxid binariesSiddhesh Poyarekar1-1/+0
GLIBC_TUNABLES scrubbing happens earlier than envvar scrubbing and some tunables are required to propagate past setxid boundary, like their env_alias. Rely on tunable scrubbing to clean out GLIBC_TUNABLES like before, restoring behaviour in glibc 2.37 and earlier. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-10-02Linux: add ST_NOSYMFOLLOWKir Kolyshkin1-1/+3
Linux v5.10 added a mount option MS_NOSYMFOLLOW, which was added to glibc in commit 0ca21427d950755b. Add the corresponding statfs/statvfs flag bit, ST_NOSYMFOLLOW. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-10-02resolve: Remove __res_context_query alloca usageAdhemerval Zanella1-31/+23
The bufsize on current Linux build is: size_t bufsize = (type == 439963904 ? 2 : 1) * (12 + 4 + 255 + 1); So with upper bound as 544 (2 * (12 + 4 + 255 + 1)). However, it might increase to 2 * PACKETSIZE later with malloc. The default scratch_buffer should fullfill the most usual allocation requirement. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Joe Simmons-Talbott <josimmon@redhat.com>
2023-10-02mips: dl-machine-reject-phdr: Get rid of alloca.Joe Simmons-Talbott1-16/+10
Read directly into the mips_abiflags struct rather than reading the entire segment and using alloca when the passed buffer is not big enough. Checked with build-many-glibcs.py on mips-linux-gnu Tested-by: Ying Huang <ying.huang@oss.cipunited.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-29x86: Add support for AVX10 preset and vec size in cpu-featuresNoah Goldstein5-3/+83
This commit add support for the new AVX10 cpu features: https://cdrdv2-public.intel.com/784267/355989-intel-avx10-spec.pdf We add checks for: - `AVX10`: Check if AVX10 is present. - `AVX10_{X,Y,Z}MM`: Check if a given vec class has AVX10 support. `make check` passes and cpuid output was checked against GNR/DMR on an emulator.
2023-09-29resolv: Fix a comment typo in __resolv_conf_loadArjun Shankar1-1/+1
The file being referred to is host.conf, not hosts.conf.
2023-09-29Remove unused -DRESOLVER getaddrinfo build flagArjun Shankar1-1/+1
getaddrinfo doesn't look for any RESOLVER defines for conditional compilation. Therefore, remove the unnecessary -DRESOLVER build flag in getaddrinfo's CFLAGS. Checked on x86_64 for code generation changes; none found.
2023-09-28C2x scanf %wN, %wfN supportJoseph Myers8-0/+598
ISO C2x defines scanf length modifiers wN (for intN_t / int_leastN_t / uintN_t / uint_leastN_t) and wfN (for int_fastN_t / uint_fastN_t). Add support for those length modifiers, similar to the printf support previously added. Tested for x86_64 and x86.
2023-09-28test-container: Use nftw instead of rm -rfAdhemerval Zanella1-23/+11
If the binary to run is 'env', test-containers skips it and adds any required environment variable on the process envs variables. This simplifies the required code to spawn new process (no need to build an env-like program). However, this is an issue for recursive_remove if there is any LD_PRELOAD, since test-container will not prepend the loader command along with required paths. If the required preloaded library can not be loaded by the system glibc, the 'post-clean rsync' will eventually fail. One example is if system glibc does not support DT_RELR and the built glibc does, the nss/tst-nss-gai-hv2-canonname test fails with: ../scripts/evaluate-test.sh nss/tst-nss-gai-hv2-canonname $? false false 86_64-linux-gnu/nss/tst-nss-gai-hv2-canonname.test-result rm: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by x86_64-linux-gnu/malloc/libc_malloc_debug.so) Instead trying to figure out the required loader arguments on how to spawn the 'rm -rf', replace the command with a nftw call. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Stefan Liebler <stli@linux.ibm.com>
2023-09-28hurd: Drop REG_GSFS and REG_ESDS from x86_64's ucontextSamuel Thibault4-16/+8
These are useless on x86_64, and __NGREG was actually wrong with them.
2023-09-27elf: Fix compile error with -DNDEBUG [BZ #18755]Qingqing Li1-1/+1
Compilation fails when building with -DNDEBUG after commit a3189f66a5f2fe86568286fa025fa153be04c6c0. Here is the error: dl-close.c: In function ‘_dl_close_worker’: dl-close.c:140:22: error: unused variable ‘nloaded’ [-Werror=unused-variable] 140 | const unsigned int nloaded = ns->_ns_nloaded; Add __attribute_maybe_unused__ for‘nloaded’to fix it. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-27MIPS: Add relocation typesYing Huang1-1/+59
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-27MIPS: Add new section type SHT_MIPS_ABIFLAGSYing Huang1-0/+1
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-27MIPS: Add ELF file header flagsYing Huang1-1/+47
Now binutils use some E_MIPS_* macros and EF_MIPS_* macros, it is difficult to decide which style macro we should use when we want to add new ELF file header flags. IRIX used to use EF_MIPS_* macros and in elf/elf.h there also has comments "The following are unofficial names and should not be used". So we should use EF_MIPS_* to keep same style with the beginning. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-27fegetenv_and_set_rn now uses the builtins provided by GCC.Manjunath Matti1-0/+9
On powerpc, SET_RESTORE_ROUND uses inline assembly to optimize the prologue get/save/set rounding mode operations for POWER9 and later by using 'mffscrn' where possible, this was introduced by commit f1c56cdff09f650ad721fae026eb6a3651631f3d. GCC version 14 onwards supports builtins as __builtin_set_fpscr_rn which now returns the FPSCR fields in a double. This feature is available on Power9 when the __SET_FPSCR_RN_RETURNS_FPSCR__ macro is defined. GCC commit ef3bbc69d15707e4db6e2f198c621effb636cc26 adds this feature. Changes are done to use __builtin_set_fpscr_rn instead of mffscrn or mffscrni in __fe_mffscrn(rn). Suggested-by: Carl Love <cel@us.ibm.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-09-27io: Do not implement fstat with fstatatAdhemerval Zanella3-12/+68
AT_EMPTY_PATH is a requirement to implement fstat over fstatat, however it does not prevent the kernel to read the path argument. It is not an issue, but on x86-64 with SMAP-capable CPUs the kernel is forced to perform expensive user memory access. After that regular lookup is performed which adds even more overhead. Instead, issue the fstat syscall directly on LFS fstat implementation (32 bit architectures will still continue to use statx, which is required to have 64 bit time_t support). it should be even a small performance gain on non x86_64, since there is no need to handle the path argument. Checked on x86_64-linux-gnu.
2023-09-26libio: Add nonnull attribute for most FILE * arguments in stdio.hXi Ruoyao3-78/+99
During the review of a GCC analyzer test case, we found most stdio functions accepting a FILE * argument expect it to be nonnull and just segfault when the argument is NULL. Add nonnull attribute for them. fflush and fflush_unlocked are well defined when __stream is NULL so they are not touched. For fputs, fgets, fread, fwrite, fprintf, vfprintf, and their unlocked version, if __stream is empty but there is nothing to read or write, they did not segfault. But the standard disallow __stream to be empty here, so nonnull attribute is also added for them. Note that this may blow up some old code already subtly broken. Also add __nonnull for _chk variants and __fortify_function versions for them. Signed-off-by: Xi Ruoyao <xry111@xry111.site> Reviewed-by: Alejandro Colomar <alx@kernel.org> Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-09-26AArch64: Remove -0.0 check from vector sinWilco Dijkstra2-12/+2
Remove the unnecessary extra checks for sin (-0.0) from vector sin/sinf, improving performance. Passes regress. Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
2023-09-26Document CVE-2023-4806 and CVE-2023-5156 in NEWSSiddhesh Poyarekar1-0/+9
These are tracked in BZ #30884 and BZ #30843. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-09-26elf: Add dummy declaration of _dl_audit_objclose for !SHAREDFlorian Weimer1-1/+8
This allows us to avoid some #ifdef SHARED conditionals. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-09-25Fix leak in getaddrinfo introduced by the fix for CVE-2023-4806 [BZ #30843]Romain Geissler3-3/+24
This patch fixes a very recently added leak in getaddrinfo. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-09-21elf: dl-lookup: Remove unused alloca.h includeJoe Simmons-Talbott1-1/+0
2023-09-21Remove unused localedata/th_TH.inMike FABIAN1-178/+0
2023-09-21Adapt collation in th_TH locale to use the iso14651_t1_common file and sync ↵Mike FABIAN3-741/+252
the collation with CLDR I made it to agree as much as possible with the rules from CLDR (see: https://github.com/unicode-org/cldr/blob/main/common/collation/th.xml). It seems to be impossible to follow the CLDR rules &[before 1]๚<ฯ # should be "variable" and &๛<ๆ # should be "variable" exactly though. These ask for a primary difference in punctuation characters whose primary weight should be "IGNORE". But using a secondary differnence instead still sorts the test data correctly and the previously used collation in th_TH used tertiary differences for these characters. There was old localedata/th_TH.in test data in TIS-620 encoding which was not used (it was not in the localedata/Makefile). I converted this to UTF-8 and moved it to localedata/th_TH.UTF-8.in and added it to localedata/Makefile. Using the existing collation rules in the th_TH locale did not sort that test file completely correct, I think my new collation rules based on iso14651_t1 are better.
2023-09-21Revert "LoongArch: Add glibc.cpu.hwcap support."caiyinyu11-329/+8
This reverts commit a53451559dc9cce765ea5bcbb92c4007e058e92b.
2023-09-20Update kernel version to 6.5 in header constant testsJoseph Myers2-2/+2
This patch updates the kernel version in the tests tst-mman-consts.py and tst-pidfd-consts.py to 6.5. (There are no new constants covered by these tests in 6.5 that need any other header changes; tst-mount-consts.py was updated separately along with a header constant addition.) Tested with build-many-glibcs.py.
2023-09-19LoongArch: Add glibc.cpu.hwcap support.caiyinyu11-8/+329
Key Points: 1. On lasx & lsx platforms, We must use _dl_runtime_{profile, resolve}_{lsx, lasx} to save vector registers. 2. Via "tunables", users can choose str/mem_{lasx,lsx,unaligned} functions with `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,...`. Note: glibc.cpu.hwcaps doesn't affect _dl_runtime_{profile, resolve}_{lsx, lasx} selection. Usage Notes: 1. Only valid inputs: LASX, LSX, UAL. Case-sensitive, comma-separated, no spaces. 2. Example: `export GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL` turns on LASX & UAL. Unmentioned features turn off. With default ifunc: lasx > lsx > unaligned > aligned > generic, effect is: lasx > unaligned > aligned > generic; lsx off. 3. Incorrect GLIBC_TUNABLES settings will show error messages. For example: On lsx platforms, you cannot enable lasx features. If you do that, you will get error messages. 4. Valid input examples: - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX: lasx > aligned > generic. - GLIBC_TUNABLES=glibc.cpu.hwcaps=LSX,UAL: lsx > unaligned > aligned > generic. - GLIBC_TUNABLES=glibc.cpu.hwcaps=LASX,UAL,LASX,UAL,LSX,LASX,UAL: Repetitions allowed but not recommended. Results in: lasx > lsx > unaligned > aligned > generic.
2023-09-18math: Add a no-mathvec flag for sin (-0.0)Wilco Dijkstra4-28/+33
Add support for a no-mathvec flag to gen-auto-libm-tests.c. Update input test sin (-0.0) to be skipped in vector math libraries and regenerate testcases. Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
2023-09-16Update to Unicode 15.1.0 [BZ #30854]Mike FABIAN14-2814/+3155
Unicode 15.1.0 Support: Character encoding, character type info, and transliteration tables are all updated to Unicode 15.1.0, using the generator scripts contributed by Mike FABIAN (Red Hat). Total removed characters in newly generated CHARMAP: 0 Total changed characters in newly generated CHARMAP: 0 Total added characters in newly generated CHARMAP: 627 Total removed characters in newly generated WIDTH: 0 Total changed characters in newly generated WIDTH: 0 Total added characters in newly generated WIDTH: 627 alpha: Added 622 characters in new ctype which were not in old ctype graph: Added 627 characters in new ctype which were not in old ctype print: Added 627 characters in new ctype which were not in old ctype punct: Added 5 characters in new ctype which were not in old ctype The five characters added to punct are: 2FFC;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM RIGHT;So;0;ON;;;;;N;;;;; 2FFD;IDEOGRAPHIC DESCRIPTION CHARACTER SURROUND FROM LOWER RIGHT;So;0;ON;;;;;N;;;;; 2FFE;IDEOGRAPHIC DESCRIPTION CHARACTER HORIZONTAL REFLECTION;So;0;ON;;;;;N;;;;; 2FFF;IDEOGRAPHIC DESCRIPTION CHARACTER ROTATION;So;0;ON;;;;;N;;;;; 31EF;IDEOGRAPHIC DESCRIPTION CHARACTER SUBTRACTION;So;0;ON;;;;;N;;;;; The Unicode announcement blog entry says "[...] adds 627 characters, [...] additions include 622 CJK unified ideographs in a new block, [...]", so that looks OK. The Unicode blog mentions "six completely new emoji" but they don't appear here as they are all sequences and not single code points. Resolves: BZ #30854 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-09-16localedata/unicode-gen/utf8_gen.py: adapt regexp to get relevant lines from ↵Mike FABIAN1-1/+1
EastAsianWidth.txt Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-09-16Fix regexp syntax warnings in localedata/unicode-gen/ctype_compatibility.pyMike FABIAN1-13/+13
Fix these: $ python -m py_compile ./ctype_compatibility.py ./ctype_compatibility.py:146: SyntaxWarning: invalid escape sequence '\)' Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-09-15getaddrinfo: Fix use after free in getcanonname (CVE-2023-4806)Siddhesh Poyarekar7-10/+152
When an NSS plugin only implements the _gethostbyname2_r and _getcanonname_r callbacks, getaddrinfo could use memory that was freed during tmpbuf resizing, through h_name in a previous query response. The backing store for res->at->name when doing a query with gethostbyname3_r or gethostbyname2_r is tmpbuf, which is reallocated in gethosts during the query. For AF_INET6 lookup with AI_ALL | AI_V4MAPPED, gethosts gets called twice, once for a v6 lookup and second for a v4 lookup. In this case, if the first call reallocates tmpbuf enough number of times, resulting in a malloc, th->h_name (that res->at->name refers to) ends up on a heap allocated storage in tmpbuf. Now if the second call to gethosts also causes the plugin callback to return NSS_STATUS_TRYAGAIN, tmpbuf will get freed, resulting in a UAF reference in res->at->name. This then gets dereferenced in the getcanonname_r plugin call, resulting in the use after free. Fix this by copying h_name over and freeing it at the end. This resolves BZ #30843, which is assigned CVE-2023-4806. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>