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]
Message-Id: <20061227172828.998757000@mvista.com>
Date:	Wed, 27 Dec 2006 09:28:29 -0800
From:	Daniel Walker <dwalker@...sta.com>
To:	mingo@...e.hu
CC:	Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH -rt] disconnect warp check from hrtimers

These calls were getting inconsistent wrt. the xtime_lock. The xtime_lock should
be held when doing the warp check update, and interrupts should be off.

In some places the warp update was getting called twice, once under the xtime_lock
then again right outside the xtime_lock.

Signed-Off-By: Daniel Walker <dwalker@...sta.com>

---
 include/linux/hrtimer.h |    2 +-
 kernel/hrtimer.c        |    2 --
 kernel/time/ntp.c       |    2 ++
 kernel/timer.c          |    1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

Index: linux-2.6.19/include/linux/hrtimer.h
===================================================================
--- linux-2.6.19.orig/include/linux/hrtimer.h
+++ linux-2.6.19/include/linux/hrtimer.h
@@ -262,7 +262,7 @@ static inline ktime_t hrtimer_cb_get_tim
  * is expired in the next softirq when the clock was advanced.
  * (we still call the warp-check debugging code)
  */
-static inline void clock_was_set(void) { warp_check_clock_was_changed(); }
+static inline void clock_was_set(void) { }
 static inline void hrtimer_clock_notify(void) { }
 
 /*
Index: linux-2.6.19/kernel/hrtimer.c
===================================================================
--- linux-2.6.19.orig/kernel/hrtimer.c
+++ linux-2.6.19/kernel/hrtimer.c
@@ -452,8 +452,6 @@ static void retrigger_next_event(void *a
  */
 void clock_was_set(void)
 {
-	warp_check_clock_was_changed();
-
 	/* Retrigger the CPU local events everywhere */
 	on_each_cpu(retrigger_next_event, NULL, 0, 1);
 }
Index: linux-2.6.19/kernel/time/ntp.c
===================================================================
--- linux-2.6.19.orig/kernel/time/ntp.c
+++ linux-2.6.19/kernel/time/ntp.c
@@ -116,6 +116,7 @@ void second_overflow(void)
 			 */
 			time_interpolator_update(-NSEC_PER_SEC);
 			time_state = TIME_OOP;
+			warp_check_clock_was_changed();
 			clock_was_set();
 			printk(KERN_NOTICE "Clock: inserting leap second "
 					"23:59:60 UTC\n");
@@ -131,6 +132,7 @@ void second_overflow(void)
 			 */
 			time_interpolator_update(NSEC_PER_SEC);
 			time_state = TIME_WAIT;
+			warp_check_clock_was_changed();
 			clock_was_set();
 			printk(KERN_NOTICE "Clock: deleting leap second "
 					"23:59:59 UTC\n");
Index: linux-2.6.19/kernel/timer.c
===================================================================
--- linux-2.6.19.orig/kernel/timer.c
+++ linux-2.6.19/kernel/timer.c
@@ -1162,6 +1162,7 @@ static int timekeeping_resume(struct sys
 	clock->cycle_last = clocksource_read(clock);
 	clock->error = 0;
 	timekeeping_suspended = 0;
+	warp_check_clock_was_changed();
 	write_sequnlock_irqrestore(&xtime_lock, flags);
 
 	hrtimer_notify_resume();
--
-
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