public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: Fix fstatat with !XSTAT_IS_XSTAT64 and __TIMESIZE=64 (BZ #29730)
@ 2022-10-28 20:54 Aurelien Jarno
  2022-10-31 16:03 ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 8+ messages in thread
From: Aurelien Jarno @ 2022-10-28 20:54 UTC (permalink / raw)
  To: libc-alpha; +Cc: Adhemerval Zanella, Aurelien Jarno

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-01 21:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 20:54 [PATCH] linux: Fix fstatat with !XSTAT_IS_XSTAT64 and __TIMESIZE=64 (BZ #29730) Aurelien Jarno
2022-10-31 16:03 ` Adhemerval Zanella Netto
2022-10-31 17:25   ` Adhemerval Zanella Netto
2022-10-31 22:20     ` Aurelien Jarno
2022-11-01 10:55       ` Aurelien Jarno
2022-11-01 11:57         ` Aurelien Jarno
2022-11-01 12:40           ` Adhemerval Zanella Netto
2022-11-01 21:31             ` Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).