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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061116165201.GA18128@dwarf.suse.cz>
Date:	Thu, 16 Nov 2006 17:52:01 +0100
From:	Jiri Bohac <jbohac@...e.cz>
To:	linux-kernel@...r.kernel.org
Cc:	ak@...e.de, vojtech@...e.cz
Subject: [PATCH for 2.6.19] Fix xtime losing ticks

xtime is not properly incremented when main timer ticks are lost.
Whatever the number of ticks elapsed is, only one tick worth of time
is added to xtime. This patch fixes that.

Signed-off-by: Jiri Bohac <jbohac@...e.cz>

Index: linux-2.6.19-rc5/kernel/timer.c
===================================================================
--- linux-2.6.19-rc5.orig/kernel/timer.c
+++ linux-2.6.19-rc5/kernel/timer.c
@@ -904,7 +904,7 @@ static void clocksource_adjust(struct cl
  *
  * Called from the timer interrupt, must hold a write on xtime_lock.
  */
-static void update_wall_time(void)
+static void update_wall_time(unsigned long ticks)
 {
 	cycle_t offset;
 
@@ -915,7 +915,7 @@ static void update_wall_time(void)
 #ifdef CONFIG_GENERIC_TIME
 	offset = (clocksource_read(clock) - clock->cycle_last) & clock->mask;
 #else
-	offset = clock->cycle_interval;
+	offset = ticks * clock->cycle_interval;
 #endif
 	clock->xtime_nsec += (s64)xtime.tv_nsec << clock->shift;
 
@@ -1053,7 +1053,7 @@ void run_local_timers(void)
  */
 static inline void update_times(unsigned long ticks)
 {
-	update_wall_time();
+	update_wall_time(ticks);
 	calc_load(ticks);
 }
   
-- 
Jiri Bohac <jbohac@...e.cz>
SUSE Labs, SUSE CR

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ