提交 1272eeed 编写于 作者: Y Yu Liao 提交者: Yang Yingliang

Revert "posix-cpu-timers: Avoid undefined behaviour in timespec64_to_ns()"

hulk inclusion
category: bugfix
bugzilla: 185900, https://gitee.com/openeuler/kernel/issues/I4MOGB
CVE: NA

-----------------------------------------------

This reverts commit 2a3c5819.
Commit c0b52741 fixes undefined behaviour in timespec64_to_ns(),
so just revert it.
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 bce69857
...@@ -877,14 +877,6 @@ static int do_timer_settime(timer_t timer_id, int flags, ...@@ -877,14 +877,6 @@ static int do_timer_settime(timer_t timer_id, int flags,
if (!timespec64_valid(&new_spec64->it_interval) || if (!timespec64_valid(&new_spec64->it_interval) ||
!timespec64_valid(&new_spec64->it_value)) !timespec64_valid(&new_spec64->it_value))
return -EINVAL; return -EINVAL;
if (new_spec64->it_interval.tv_sec >= KTIME_SEC_MAX) {
new_spec64->it_interval.tv_sec = KTIME_SEC_MAX;
new_spec64->it_interval.tv_nsec = 0;
}
if (new_spec64->it_value.tv_sec >= KTIME_SEC_MAX) {
new_spec64->it_value.tv_sec = KTIME_SEC_MAX;
new_spec64->it_value.tv_nsec = 0;
}
if (old_spec64) if (old_spec64)
memset(old_spec64, 0, sizeof(*old_spec64)); memset(old_spec64, 0, sizeof(*old_spec64));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册