time: Normalize timespec64 before timespec64_compare()
hulk inclusion category: bugfix bugzilla: 185831, https://gitee.com/openeuler/kernel/issues/I4MO2G CVE: NA ------------------------------------------------- Passing unnormalized timespec64 to timespec64_compare() may cause incorrect results. For example: wall_to_monotonic = {tv_sec = -10, tv_nsec = 900000000} ts_delta = {tv_sec = -9, tv_nsec = -900000000} timespec64_compare() returns -1, but actually wall_to_monotonic > ts_delta. This will cause wall_to_monotonic to become a positive number. Use timespec64_sub() instead of direct subtraction to avoid this. Signed-off-by: NYu Liao <liaoyu15@huawei.com> Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录