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: <20170117125624.8535-1-shorne@gmail.com>
Date:   Tue, 17 Jan 2017 21:56:23 +0900
From:   Stafford Horne <shorne@...il.com>
To:     linux-kernel@...r.kernel.org
Cc:     Stafford Horne <shorne@...il.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Kees Cook <keescook@...omium.org>,
        Jessica Yu <jeyu@...hat.com>, Petr Mladek <pmladek@...e.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Yang Shi <yang.shi@...aro.org>, Tejun Heo <tj@...nel.org>,
        Prarit Bhargava <prarit@...hat.com>,
        Yaowei Bai <baiyaowei@...s.chinamobile.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>
Subject: [PATCH -next] init/main: Init jump_labels before they are used to build zonelists

A recent change in -next introduced static_keys in init zonelists,
details are:

  Author: Vlastimil Babka <vbabka@...e.cz>
  Date:   Thu Jan 12 12:19:03 2017 +1100
  commit f5adbdff6a1c40e19 ("mm, page_alloc: convert
  page_group_by_mobility_disable to static key")

This causes the following warning in openrisc as reported by Guenter,
and repoduced by me.

 WARNING: CPU: 0 PID: 0 at ./include/linux/jump_label.h:198 0xc02d758c
 static_key_slow_inc used before call to jump_label_init

This fixes this by initialized jump_labels even earlier, I am suprized the
issue is not showing up in other platforms yet.

Cc: Vlastimil Babka <vbabka@...e.cz>
Signed-off-by: Stafford Horne <shorne@...il.com>
---
 init/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/init/main.c b/init/main.c
index 8b1adb6e..d1ca7cb 100644
--- a/init/main.c
+++ b/init/main.c
@@ -513,6 +513,7 @@ asmlinkage __visible void __init start_kernel(void)
 	boot_cpu_state_init();
 	smp_prepare_boot_cpu();	/* arch-specific boot-cpu hooks */
 
+	jump_label_init();
 	build_all_zonelists(NULL, NULL);
 	page_alloc_init();
 
@@ -526,8 +527,6 @@ asmlinkage __visible void __init start_kernel(void)
 		parse_args("Setting init args", after_dashes, NULL, 0, -1, -1,
 			   NULL, set_init_arg);
 
-	jump_label_init();
-
 	/*
 	 * These use large bootmem allocations and must precede
 	 * kmem_cache_init()
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ