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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Feb 2017 17:31:03 +0300
From:   Andrey Drobyshev <immortalguardian1@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     gq@...msu.su, giometti@...eenne.com
Subject: [PATCH 2/8] ntp/pps: ignore pps_valid decreasing if there is no pps signal.

From: Alexander GQ Gerasiov <gq@...msu.su>

In case pps_dec_valid() is called from second_overflow() in the
absence of pps signal, there is no need to decrease pps_valid.

Signed-off-by: Alexander GQ Gerasiov <gq@...msu.su>
---
 kernel/time/ntp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index d20891e..22f2235 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -154,6 +154,10 @@ static inline void pps_clear(void)
  */
 static inline void pps_dec_valid(void)
 {
+	/* Silently ignore if PPS was not turned on */
+	if (!(time_status & STA_PPSSIGNAL))
+		return;
+
 	if (pps_valid > 0)
 		pps_valid--;
 	else {
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ