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:   Mon, 13 Nov 2017 14:15:26 -0800
From:   "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:     Jason Baron <jbaron@...mai.com>
Cc:     rostedt@...dmis.org, peterz@...radead.org,
        linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] jump_label: invoke jump_label_test() via early_initcall()

On Mon, Nov 13, 2017 at 04:48:47PM -0500, Jason Baron wrote:
> Fengguang Wu reported that running the rcuperf test during boot can cause
> the jump_label_test() to hit a WARN_ON(). The issue is that the core jump
> label code relies on kernel_text_address() to detect when it can no longer
> update branches that may be contained in __init sections. The
> kernel_text_address() in turn assumes that if the system_state variable is
> greter than or equal to SYSTEM_RUNNING then __init sections are no longer
> valid (since the assumption is that they have been freed). However, when
> rcuperf is setup to run in early boot it can call kernel_power_off() which
> sets the system_state to SYSTEM_POWER_OFF.
> 
> Since rcuperf initialization is invoked via a module_init(), we can make
> the dependency of jump_label_test() needing to complete before rcuperf
> explicit by calling it via early_initcall().
> 
> Reported-by: Fengguang Wu <fengguang.wu@...el.com>
> Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Ingo Molnar <mingo@...nel.org>
> Signed-off-by: Jason Baron <jbaron@...mai.com>

Looks way simpler than handling this three times in rcuperf, rcutorture,
and locktorture!

Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

> ---
>  kernel/jump_label.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/jump_label.c b/kernel/jump_label.c
> index 0bf2e8f5..7c3774a 100644
> --- a/kernel/jump_label.c
> +++ b/kernel/jump_label.c
> @@ -769,7 +769,7 @@ static __init int jump_label_test(void)
> 
>  	return 0;
>  }
> -late_initcall(jump_label_test);
> +early_initcall(jump_label_test);
>  #endif /* STATIC_KEYS_SELFTEST */
> 
>  #endif /* HAVE_JUMP_LABEL */
> -- 
> 2.6.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ