[PATCH] linux: Fix fstatat with !XSTAT_IS_XSTAT64 and __TIMESIZE=64 (BZ #29730)
Aurelien Jarno
aurelien@aurel32.net
Fri Oct 28 20:54:40 GMT 2022
Commit 6e8a0aac2f883 ("time: Fix overflow itimer tests on 32-bit
systems") changed in_time_t_range to assume a 32-bit time_t. Therefore
stop calling it from __fstatat for systems with 64-bit time_t.
Resolves: BZ #29730
---
sysdeps/unix/sysv/linux/fstatat.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/fstatat.c b/sysdeps/unix/sysv/linux/fstatat.c
index 055fb4762e..afe93b6cf4 100644
--- a/sysdeps/unix/sysv/linux/fstatat.c
+++ b/sysdeps/unix/sysv/linux/fstatat.c
@@ -33,9 +33,13 @@ __fstatat (int fd, const char *file, struct stat *buf, int flag)
if (! in_ino_t_range (st64.st_ino)
|| ! in_off_t_range (st64.st_size)
|| ! in_blkcnt_t_range (st64.st_blocks)
+/* in_time_t_range assumes that all usages are for sizeof(time_t) == 32. */
+# if __TIMESIZE != 64
|| ! in_time_t_range (st64.st_atim.tv_sec)
|| ! in_time_t_range (st64.st_mtim.tv_sec)
- || ! in_time_t_range (st64.st_ctim.tv_sec))
+ || ! in_time_t_range (st64.st_ctim.tv_sec)
+# endif
+ )
return INLINE_SYSCALL_ERROR_RETURN_VALUE (EOVERFLOW);
/* Clear internal pad and reserved fields. */
--
2.35.1
More information about the Libc-alpha
mailing list