Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionMichael Halstead
2021-06-23 22:51:37 UTC
Description of problem:
Recently backported time64 syscalls fail with large values. Discovered when attempting to set file times.
> utimensat_time64(AT_FDCWD, "../install/usr/local/lib/cmake/assimp-4.1/assimp-config.cmake",
> [{tv_sec=1622966723, tv_nsec=6319439026193432576}, {tv_sec=1622966579, tv_nsec=17840053692309438464}], 0) = -1
> EINVAL (Invalid argument)
tv_nsec may be being clamped to LONG_MAX of 4 bytes but should be
a LONG_LONG_MAX of 8 bytes on a 32 bit since the field is a 64 bit long.
Version-Release number of selected component (if applicable):
Problem began after upgrading from 4.18.0-240.15.1.el8_3.x86_64 to 4.18.0-305.3.1.el8.x86_64.
Steps to Reproduce:
quick test bit of code (which makes assumptions about 32 bit):
#include <unistd.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
struct timespec64 {
long long tv_sec; /* seconds */
long long tv_nsec; /* nanoseconds */
};
int main() {
int fd = open("foo", O_RDWR | O_CREAT, 0644);
write(fd, "foo", 3);
struct timespec64 times[2] = {};
times[0].tv_sec = 1622966723;
times[0].tv_nsec = 631943;
times[1].tv_sec = 1622966579;
times[1].tv_nsec = 178400;
int rc = syscall(SYS_utimensat_time64, fd, NULL, ×[0], 0);
printf("rc=%d\n", rc);
close(fd);
return rc;
}
built with "gcc -m32 test-syscall.c -o test" and run with "strace ./test".
This works on all the systems I tried it in. As does:
times[0].tv_sec = 1;
times[0].tv_nsec = 2;
times[1].tv_sec = 3;
times[1].tv_nsec = 4;
however if you set (and ignore the compiler warning):
times[0].tv_sec = 1622966723;
times[0].tv_nsec = 6319439026193432576;
times[1].tv_sec = 1622966579;
times[1].tv_nsec = 17840053692309438464;
then you see EINVAL on the latest kernel (tested with 4.18.0-305 and 4.18.0-310).
Description of problem: Recently backported time64 syscalls fail with large values. Discovered when attempting to set file times. > utimensat_time64(AT_FDCWD, "../install/usr/local/lib/cmake/assimp-4.1/assimp-config.cmake", > [{tv_sec=1622966723, tv_nsec=6319439026193432576}, {tv_sec=1622966579, tv_nsec=17840053692309438464}], 0) = -1 > EINVAL (Invalid argument) tv_nsec may be being clamped to LONG_MAX of 4 bytes but should be a LONG_LONG_MAX of 8 bytes on a 32 bit since the field is a 64 bit long. Version-Release number of selected component (if applicable): Problem began after upgrading from 4.18.0-240.15.1.el8_3.x86_64 to 4.18.0-305.3.1.el8.x86_64. Steps to Reproduce: quick test bit of code (which makes assumptions about 32 bit): #include <unistd.h> #include <sys/syscall.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdio.h> struct timespec64 { long long tv_sec; /* seconds */ long long tv_nsec; /* nanoseconds */ }; int main() { int fd = open("foo", O_RDWR | O_CREAT, 0644); write(fd, "foo", 3); struct timespec64 times[2] = {}; times[0].tv_sec = 1622966723; times[0].tv_nsec = 631943; times[1].tv_sec = 1622966579; times[1].tv_nsec = 178400; int rc = syscall(SYS_utimensat_time64, fd, NULL, ×[0], 0); printf("rc=%d\n", rc); close(fd); return rc; } built with "gcc -m32 test-syscall.c -o test" and run with "strace ./test". This works on all the systems I tried it in. As does: times[0].tv_sec = 1; times[0].tv_nsec = 2; times[1].tv_sec = 3; times[1].tv_nsec = 4; however if you set (and ignore the compiler warning): times[0].tv_sec = 1622966723; times[0].tv_nsec = 6319439026193432576; times[1].tv_sec = 1622966579; times[1].tv_nsec = 17840053692309438464; then you see EINVAL on the latest kernel (tested with 4.18.0-305 and 4.18.0-310).