-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/vfscore: Accept negative timestamps #991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreittr the changes make sense, but shouldn't they be made in is_timeval_valid
too (since that is the function that is eventually called by the utime
syscall)?
Previously vfs code would reject timestamps that are more than 1 second before the epoch as invalid. This is wrong; unix time is defined as a signed offset and as such can and must support dates before the epoch. This change relaxes the overly-strict validity check, allowing the full range of valid file timestamps to be used. Signed-off-by: Andrei Tatar <andrei@unikraft.io>
a1263f7
to
9f11dc8
Compare
Good catch, thanks! Updated with fix. |
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thank you.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Description of changes
Previously vfs code would reject timestamps that are more than 1 second before the epoch as invalid. This is wrong; unix time is defined as a signed offset and as such can and must support dates before the epoch. This change relaxes the overly-strict validity check, allowing the full range of valid file timestamps to be used.
Prerequisite checklist
checkpatch.uk
on your commit series before opening this PR;Base target
Additional configuration
Test with: