lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Jan 2021 18:58:47 +0000
From:   "Zhou Ti (x2019cwm)" <x2019cwm@...x.ca>
To:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH] fix the issue that the tick_nohz_get_sleep_length() function
 could return a negative value

Fix the issue that the tick_nohz_get_sleep_length() function could return
a negative value.

The variable "next_event" has a small possibility to be smaller than the
variable "now" during running. Since both the menu idle governor and the
teo idle governor use u64 to store the return value of the function, this
may result in an extremely large and invalid value.

One can easily detect the existence of this issue by using printk to
output a warning.

Signed-off-by: Ti Zhou <x2019cwm@...x.ca>
---
--- tip/kernel/time/tick-sched.c.orig   2021-01-20 05:34:25.151325912 -0400
+++ tip/kernel/time/tick-sched.c        2021-01-20 07:09:15.060980886 -0400
@@ -1156,6 +1156,9 @@ ktime_t tick_nohz_get_sleep_length(ktime
        next_event = min_t(u64, next_event,
                           hrtimer_next_event_without(&ts->sched_timer));

+       if (unlikely(next_event < now))
+               next_event = now;
+
        return ktime_sub(next_event, now);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ