glibc/glibc-upstream-2.34-38.patch
Florian Weimer 65faa39b43 Sync with upstream branch release/2.34/master
Upstream commit: 6548a9bdba95b3e1fcdbd85445342467e4b0cd4f

- Avoid warning: overriding recipe for .../tst-ro-dynamic-mod.so
- ld.so: Initialize bootstrap_map.l_ld_readonly [BZ #28340]
- ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340]
- Handle NULL input to malloc_usable_size [BZ #28506]
- elf: Avoid deadlock between pthread_create and ctors [BZ #28357]
- timex: Use 64-bit fields on 32-bit TIMESIZE=64 systems (BZ #28469)
- y2038: Use a common definition for stat for sparc32
- elf: Replace nsid with args.nsid [BZ #27609]
- S390: Add PCI_MIO and SIE HWCAPs
- support: Also return fd when it is 0
2021-11-03 11:01:29 +01:00

42 lines
1.6 KiB
Diff

commit cb9b8b5d7670df1a13544857640efd86a299d0e4
Author: Stafford Horne <shorne@gmail.com>
Date: Fri Oct 15 06:17:41 2021 +0900
timex: Use 64-bit fields on 32-bit TIMESIZE=64 systems (BZ #28469)
This was found when testing the OpenRISC port I am working on. These
two tests fail with SIGSEGV:
FAIL: misc/tst-ntp_gettime
FAIL: misc/tst-ntp_gettimex
This was found to be due to the kernel overwriting the stack space
allocated by the timex structure. The reason for the overwrite being
that the kernel timex has 64-bit fields and user space code only
allocates enough stack space for timex with 32-bit fields.
On 32-bit systems with TIMESIZE=64 __USE_TIME_BITS64 is not defined.
This causes the timex structure to use 32-bit fields with type
__syscall_slong_t.
This patch adjusts the ifdef condition to allow 32-bit systems with
TIMESIZE=64 to use the 64-bit long long timex definition.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(Cherry picked from commit 1d550265a75b412cea4889a50b101395f6a8e025)
diff --git a/sysdeps/unix/sysv/linux/bits/timex.h b/sysdeps/unix/sysv/linux/bits/timex.h
index ee37694e8f09a8e4..4a5db6deca10de58 100644
--- a/sysdeps/unix/sysv/linux/bits/timex.h
+++ b/sysdeps/unix/sysv/linux/bits/timex.h
@@ -25,7 +25,7 @@
struct timex
{
-# ifdef __USE_TIME_BITS64
+# if defined __USE_TIME_BITS64 || (__TIMESIZE == 64 && __WORDSIZE == 32)
unsigned int modes; /* mode selector */
int :32; /* pad */
long long offset; /* time offset (usec) */