From 23a874d06fd5393aa44052e2c1c995cc372a1bf1 Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Wed, 15 Dec 2021 17:30:01 +0800 Subject: [PATCH] Revert "timekeeping: Fix ktime_add overflow in tk_set_wall_to_mono" hulk inclusion category: bugfix bugzilla: 185900, https://gitee.com/openeuler/kernel/issues/I4MOGB CVE: NA ------------------------------------------------- This reverts commit 56ef5ae6322ae29833a610bb5c75dcab1f50b133. Commit 7a8e61f84786 force upper bound for setting CLOCK_REALTIME. The realtime is limited, so just revert it. Signed-off-by: Yu Liao Reviewed-by: Xiongfeng Wang Signed-off-by: Yang Yingliang --- kernel/time/timekeeping.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5a91ac540a47..f246818e35db 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -144,8 +144,7 @@ static void tk_set_wall_to_mono(struct timekeeper *tk, struct timespec64 wtm) tk->wall_to_monotonic = wtm; set_normalized_timespec64(&tmp, -wtm.tv_sec, -wtm.tv_nsec); tk->offs_real = timespec64_to_ktime(tmp); - tk->offs_tai = ktime_add_safe(tk->offs_real, - ktime_set(tk->tai_offset, 0)); + tk->offs_tai = ktime_add(tk->offs_real, ktime_set(tk->tai_offset, 0)); } static inline void tk_update_sleep_time(struct timekeeper *tk, ktime_t delta) -- GitLab