From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A294F3858C53; Fri, 28 Oct 2022 19:39:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A294F3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666985986; bh=OghF8v99+QILqoL+77CDfzB+8rw7kaNMb6xTTdqcvJ8=; h=From:To:Subject:Date:From; b=Cb4NPhticQkq8bduoCkmD0lvr/MsSfJkB8ESpkx3Vi88WkqVHPHJQ4hZ4rf+FrABc iS+i0Wl5VLdRriF+krnH0dcaGMSCg36rCYQ5gu7ww4zbaDi+jML/owqz9rCA+HVHub geJ2KROrxTkhJ89JQ6ZUdHr2NVxt61/FtQUIYTLM= From: "aurelien at aurel32 dot net" To: glibc-bugs@sourceware.org Subject: [Bug libc/29730] New: broken y2038 support in fstatat on MIPS N64 Date: Fri, 28 Oct 2022 19:39:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aurelien at aurel32 dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcchost cf_gcctarget cf_gccbuild Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29730 Bug ID: 29730 Summary: broken y2038 support in fstatat on MIPS N64 Product: glibc Version: 2.35 Status: NEW Severity: normal Priority: P1 Component: libc Assignee: unassigned at sourceware dot org Reporter: aurelien at aurel32 dot net CC: adhemerval.zanella at linaro dot org, drepper.fsp at gm= ail dot com Target Milestone: --- Host: mips64el-unknown-linux-gnuabi64 Target: mips64el-unknown-linux-gnuabi64 Build: mips64el-unknown-linux-gnuabi64 On MIPS N64 the fstat/fstatat/lstat functions return EOVERFLOW when they are called on files with a mtime, atime or ctime that can't be represented with= in a=20 32-bit time_t. This should not happen as time_t is 64-bit on mips64el. This= can be reproduce for instance with: $ touch -d 20390101 t $ chmod +x t chmod: cannot access 't': Value too large for defined data type $=20 This issue has been introduced in glibc 2.35 by the following commit: commit 6e8a0aac2f883a23efb1683b120499138f9e6021 Author: Stafford Horne Date: Mon Jun 7 22:10:19 2021 +0900 time: Fix overflow itimer tests on 32-bit systems On the port of OpenRISC I am working on and it appears the rv32 port we have sets __TIMESIZE =3D=3D 64 && __WORDSIZE =3D=3D 32. This causes= the size of time_t to be 8 bytes, but the tv_sec in the kernel is still 32-= bit causing truncation. The truncations are unavoidable on these systems so skip the testing/failures by guarding with __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL6= 4. Also, futher in the tests and in other parts of code checking for time_t overflow does not work on 32-bit systems when time_t is 64-bit. As suggested by Adhemerval, update the in_time_t_range function to assume 32-bits by using int32_t. This also brings in the header for stdint.h so we can update other usages of __int32_t to int32_t as suggested by Adhemerval. Reviewed-by: Adhemerval Zanella MIPS N64 uses a 64-bit time_t, however it does not define XSTAT_IS_XSTAT64. Therefore fstatat is different than fstatat64, and uses the default sysdeps/unix/sysv/linux/fstatat.c implementation, which uses in_time_t_rang= e() with a 64-bit time_t. --=20 You are receiving this mail because: You are on the CC list for the bug.=