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]
Message-ID: <tip-2a21ad571b62440a4ad66d70b4b5d09c00029af4@git.kernel.org>
Date:   Thu, 4 Oct 2018 14:04:33 -0700
From:   tip-bot for Thomas Gleixner <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     fweimer@...hat.com, pbonzini@...hat.com, jgross@...e.com,
        kys@...rosoft.com, mingo@...nel.org, peterz@...radead.org,
        john.stultz@...aro.org, linux-kernel@...r.kernel.org,
        matt@...trans.com.au, sboyd@...nel.org, vkuznets@...hat.com,
        arnd@...db.de, luto@...nel.org, tglx@...utronix.de, hpa@...or.com
Subject: [tip:x86/vdso] x86/time: Implement clocksource_arch_init()

Commit-ID:  2a21ad571b62440a4ad66d70b4b5d09c00029af4
Gitweb:     https://git.kernel.org/tip/2a21ad571b62440a4ad66d70b4b5d09c00029af4
Author:     Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Mon, 17 Sep 2018 14:45:35 +0200
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 4 Oct 2018 23:00:24 +0200

x86/time: Implement clocksource_arch_init()

Runtime validate the VCLOCK_MODE in clocksource::archdata and disable
VCLOCK if invalid, which disables the VDSO but keeps the system running.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Andy Lutomirski <luto@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Matt Rickard <matt@...trans.com.au>
Cc: Stephen Boyd <sboyd@...nel.org>
Cc: John Stultz <john.stultz@...aro.org>
Cc: Florian Weimer <fweimer@...hat.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: devel@...uxdriverproject.org
Cc: virtualization@...ts.linux-foundation.org
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Arnd Bergmann <arnd@...db.de>
Cc: Juergen Gross <jgross@...e.com>
Link: https://lkml.kernel.org/r/20180917130707.069167446@linutronix.de

---
 arch/x86/Kconfig       |  1 +
 arch/x86/kernel/time.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1a0be022f91d..adc8c96df914 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -48,6 +48,7 @@ config X86
 	select ACPI_SYSTEM_POWER_STATES_SUPPORT	if ACPI
 	select ANON_INODES
 	select ARCH_CLOCKSOURCE_DATA
+	select ARCH_CLOCKSOURCE_INIT
 	select ARCH_DISCARD_MEMBLOCK
 	select ARCH_HAS_ACPI_TABLE_UPGRADE	if ACPI
 	select ARCH_HAS_DEBUG_VIRTUAL
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index be01328eb755..1fa632e0829f 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -10,6 +10,7 @@
  *
  */
 
+#include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
@@ -105,3 +106,18 @@ void __init time_init(void)
 {
 	late_time_init = x86_late_time_init;
 }
+
+/*
+ * Sanity check the vdso related archdata content.
+ */
+void clocksource_arch_init(struct clocksource *cs)
+{
+	if (cs->archdata.vclock_mode == VCLOCK_NONE)
+		return;
+
+	if (cs->archdata.vclock_mode > VCLOCK_MAX) {
+		pr_warn("clocksource %s registered with invalid vclock_mode %d. Disabling vclock.\n",
+			cs->name, cs->archdata.vclock_mode);
+		cs->archdata.vclock_mode = VCLOCK_NONE;
+	}
+}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ