forked from rpms/glibc
73667d0be6
* Thu Apr 28 2022 Carlos O'Donell <carlos@redhat.com> - 2.34-32 - Sync with upstream branch release/2.34/master, commit c66c92181ddbd82306537a608e8c0282587131de: - posix/glob.c: update from gnulib (BZ#25659) - linux: Fix fchmodat with AT_SYMLINK_NOFOLLOW for 64 bit time_t (BZ#29097) * Wed Apr 27 2022 Carlos O'Donell <carlos@redhat.com> - 2.34-31 - Sync with upstream branch release/2.34/master, commit 55640ed3fde48360a8e8083be4843bd2dc7cecfe: - i386: Regenerate ulps - linux: Fix missing internal 64 bit time_t stat usage - x86: Optimize L(less_vec) case in memcmp-evex-movbe.S - x86: Don't set Prefer_No_AVX512 for processors with AVX512 and AVX-VNNI - x86-64: Use notl in EVEX strcmp [BZ #28646] - x86: Shrink memcmp-sse4.S code size - x86: Double size of ERMS rep_movsb_threshold in dl-cacheinfo.h - x86: Optimize memmove-vec-unaligned-erms.S - x86-64: Replace movzx with movzbl - x86-64: Remove Prefer_AVX2_STRCMP - x86-64: Improve EVEX strcmp with masked load - x86: Replace sse2 instructions with avx in memcmp-evex-movbe.S - x86: Optimize memset-vec-unaligned-erms.S - x86: Optimize memcmp-evex-movbe.S for frontend behavior and size - x86: Modify ENTRY in sysdep.h so that p2align can be specified - x86-64: Optimize load of all bits set into ZMM register [BZ #28252] - scripts/glibcelf.py: Mark as UNSUPPORTED on Python 3.5 and earlier - dlfcn: Do not use rtld_active () to determine ld.so state (bug 29078) - INSTALL: Rephrase -with-default-link documentation - misc: Fix rare fortify crash on wchar funcs. [BZ 29030] - Default to --with-default-link=no (bug 25812) - scripts: Add glibcelf.py module * Thu Apr 21 2022 Carlos O'Donell <carlos@redhat.com> - 2.34-30 - Sync with upstream branch release/2.34/master, commit 71326f1f2fd09dafb9c34404765fb88129e94237: - nptl: Fix pthread_cancel cancelhandling atomic operations - mips: Fix mips64n32 64 bit time_t stat support (BZ#29069) - hurd: Fix arbitrary error code - nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029) - S390: Add new s390 platform z16. - NEWS: Update fixed bug list for LD_AUDIT backports. - hppa: Fix bind-now audit (BZ #28857) - elf: Replace tst-audit24bmod2.so with tst-audit24bmod2 - Fix elf/tst-audit25a with default bind now toolchains - elf: Fix runtime linker auditing on aarch64 (BZ #26643) - elf: Issue la_symbind for bind-now (BZ #23734) - elf: Fix initial-exec TLS access on audit modules (BZ #28096) - elf: Add la_activity during application exit - elf: Do not fail for failed dlmopen on audit modules (BZ #28061) - elf: Issue audit la_objopen for vDSO - elf: Add audit tests for modules with TLSDESC - elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) - elf: Add _dl_audit_pltexit - elf: Add _dl_audit_pltenter - elf: Add _dl_audit_preinit - elf: Add _dl_audit_symbind_alt and _dl_audit_symbind - elf: Add _dl_audit_objclose - elf: Add _dl_audit_objsearch - elf: Add _dl_audit_activity_map and _dl_audit_activity_nsid - elf: Add _dl_audit_objopen - elf: Move la_activity (LA_ACT_ADD) after _dl_add_to_namespace_list() (BZ #28062) - elf: Move LAV_CURRENT to link_lavcurrent.h - elf: Fix elf_get_dynamic_info() for bootstrap - elf: Fix dynamic-link.h usage on rtld.c - elf: Fix elf_get_dynamic_info definition - elf: Avoid nested functions in the loader [BZ #27220] - powerpc: Delete unneeded ELF_MACHINE_BEFORE_RTLD_RELOC - hppa: Use END instead of PSEUDO_END in swapcontext.S - hppa: Implement swapcontext in assembler (bug 28960) Resolves: #2003291 Resolves: #2064181 Resolves: #2072328 Resolves: #2075713 Resolves: #2077838
117 lines
3.8 KiB
Diff
117 lines
3.8 KiB
Diff
commit 88a8637cb4658cd91a002659db05867716b88b36
|
|
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
|
|
Date: Wed Apr 27 13:40:30 2022 -0300
|
|
|
|
linux: Fix fchmodat with AT_SYMLINK_NOFOLLOW for 64 bit time_t (BZ#29097)
|
|
|
|
The AT_SYMLINK_NOFOLLOW emulation ues the default 32 bit stat internal
|
|
calls, which fails with EOVERFLOW if the file constains timestamps
|
|
beyond 2038.
|
|
|
|
Checked on i686-linux-gnu.
|
|
|
|
(cherry picked from commit 118a2aee07f64d605b6668cbe195c1f44eac6be6)
|
|
|
|
diff --git a/io/Makefile b/io/Makefile
|
|
index 9871ecbc74020a6d..01968b81042e01e4 100644
|
|
--- a/io/Makefile
|
|
+++ b/io/Makefile
|
|
@@ -81,16 +81,17 @@ tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
|
|
tst-closefrom \
|
|
|
|
tests-time64 := \
|
|
+ tst-fcntl-time64 \
|
|
+ tst-fts-time64 \
|
|
tst-futimens-time64 \
|
|
tst-futimes-time64\
|
|
- tst-fts-time64 \
|
|
+ tst-futimesat-time64 \
|
|
+ tst-lchmod-time64 \
|
|
tst-lutimes-time64 \
|
|
tst-stat-time64 \
|
|
- tst-futimesat-time64 \
|
|
tst-utime-time64 \
|
|
tst-utimensat-time64 \
|
|
tst-utimes-time64 \
|
|
- tst-fcntl-time64 \
|
|
# tests-time64
|
|
|
|
# Likewise for statx, but we do not need static linking here.
|
|
@@ -134,6 +135,7 @@ CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables
|
|
|
|
CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
|
CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE
|
|
+CFLAGS-tst-lchmod.c += -D_FILE_OFFSET_BITS=64
|
|
|
|
test-stat2-ARGS = Makefile . $(objpfx)test-stat2
|
|
|
|
diff --git a/io/tst-lchmod-time64.c b/io/tst-lchmod-time64.c
|
|
new file mode 100644
|
|
index 0000000000000000..f2b7cc9d358f2a77
|
|
--- /dev/null
|
|
+++ b/io/tst-lchmod-time64.c
|
|
@@ -0,0 +1,2 @@
|
|
+#define CHECK_TIME64
|
|
+#include "tst-lchmod.c"
|
|
diff --git a/io/tst-lchmod.c b/io/tst-lchmod.c
|
|
index 0fe98e01b74b713d..472766b186975922 100644
|
|
--- a/io/tst-lchmod.c
|
|
+++ b/io/tst-lchmod.c
|
|
@@ -66,10 +66,27 @@ select_path (bool do_relative_path, const char *full_path, const char *relative_
|
|
return full_path;
|
|
}
|
|
|
|
+static void
|
|
+update_file_time_to_y2038 (const char *fname, int flags)
|
|
+{
|
|
+#ifdef CHECK_TIME64
|
|
+ /* Y2038 threshold plus 1 second. */
|
|
+ const struct timespec ts[] = { { 0x80000001LL, 0}, { 0x80000001LL } };
|
|
+ TEST_VERIFY_EXIT (utimensat (AT_FDCWD, fname, ts, flags) == 0);
|
|
+#endif
|
|
+}
|
|
+
|
|
static void
|
|
test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t, int))
|
|
{
|
|
char *tempdir = support_create_temp_directory ("tst-lchmod-");
|
|
+#ifdef CHECK_TIME64
|
|
+ if (!support_path_support_time64 (tempdir))
|
|
+ {
|
|
+ puts ("info: test skipped, filesystem does not support 64 bit time_t");
|
|
+ return;
|
|
+ }
|
|
+#endif
|
|
|
|
char *path_dangling = xasprintf ("%s/dangling", tempdir);
|
|
char *path_file = xasprintf ("%s/file", tempdir);
|
|
@@ -93,9 +110,12 @@ test_1 (bool do_relative_path, int (*chmod_func) (int fd, const char *, mode_t,
|
|
xsymlink ("loop", path_loop);
|
|
xsymlink ("target-does-not-exist", path_dangling);
|
|
|
|
+ update_file_time_to_y2038 (path_file, 0);
|
|
+ update_file_time_to_y2038 (path_to_file, AT_SYMLINK_NOFOLLOW);
|
|
+
|
|
/* Check that the modes do not collide with what we will use in the
|
|
test. */
|
|
- struct stat64 st;
|
|
+ struct stat st;
|
|
xstat (path_file, &st);
|
|
TEST_VERIFY ((st.st_mode & 0777) != 1);
|
|
xlstat (path_to_file, &st);
|
|
diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
|
|
index 5bd1eb96a5d78130..b0cf61949a9302d9 100644
|
|
--- a/sysdeps/unix/sysv/linux/fchmodat.c
|
|
+++ b/sysdeps/unix/sysv/linux/fchmodat.c
|
|
@@ -48,8 +48,8 @@ fchmodat (int fd, const char *file, mode_t mode, int flag)
|
|
|
|
/* Use fstatat because fstat does not work on O_PATH descriptors
|
|
before Linux 3.6. */
|
|
- struct stat64 st;
|
|
- if (__fstatat64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
|
|
+ struct __stat64_t64 st;
|
|
+ if (__fstatat64_time64 (pathfd, "", &st, AT_EMPTY_PATH) != 0)
|
|
{
|
|
__close_nocancel (pathfd);
|
|
return -1;
|