Commit graph

3 commits

Author SHA1 Message Date
CismonX
750c16077c
backend: prevent timestamp overflow
When updating timestamps, make sure that the corresponding
microsecond value fits in a single signed 64-bit integer,
so that it won't result in an integer overflow, which is UB.

Also forbid timestamps before the Unix epoch, since working with
negative time_t is problematic.

This check does not apply to current timestamp, however,
add a check on backend startup to ensure sane system time.

There's no need to validate `tv_nsec`, since the kernel already
does that for us.
2025-03-20 12:46:11 +08:00
CismonX
9fab17734c
chore: misc cleanup 2025-03-07 14:35:45 +08:00
CismonX
cdf0ddfc53
init: prepare for Savannah 2024-12-31 18:09:03 +08:00