diff options
| author | Naveen Kumar Chaudhary <naveen.osdev@gmail.com> | 2026-06-02 23:37:37 +0530 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-06-02 21:07:55 +0200 |
| commit | ce4abda5e12622f33450159e76c8f56d28d7f03d (patch) | |
| tree | 18c7df540a75625d3097a6f1c3b659ca64b5ef54 /scripts/checkpatch.pl | |
| parent | c1ca14ca227e92101c7ae597213275b60f4212c6 (diff) | |
time: Fix off-by-one in settimeofday() usec validation
The validation check uses '>' instead of '>=' when comparing tv_usec
against USEC_PER_SEC, allowing the value 1000000 through. After
conversion to nanoseconds (*= 1000), this produces tv_nsec ==
NSEC_PER_SEC, violating the timespec invariant that tv_nsec must be
less than NSEC_PER_SEC.
Use '>=' to reject tv_usec values that are not in the valid range of
0 to 999999.
Fixes: 5e0fb1b57bea ("y2038: time: avoid timespec usage in settimeofday()")
Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Acked-by: John Stultz <jstultz@google.com>
Link: https://patch.msgid.link/4rikk44zew3s6577dugmx4jyblz7o5c57niuap6ct3td5yfm6w@gh7pcumg7qor
Diffstat (limited to 'scripts/checkpatch.pl')
0 files changed, 0 insertions, 0 deletions
