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] [day] [month] [year] [list]
Message-ID: <20140306131418.GB25111@hercules>
Date:	Thu, 6 Mar 2014 13:14:18 +0000
From:	Luís Henriques <luis.henriques@...onical.com>
To:	linux-kernel@...r.kernel.org, stable@...r.kernel.org,
	kernel-team@...ts.ubuntu.com
Cc:	Tony Breeds <tony@...eyournoodle.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [PATCH 3.5 61/62] powerpc/le: Ensure that the 'stop-self' RTAS
 token is handled correctly

On Wed, Mar 05, 2014 at 02:37:05PM +0000, Luis Henriques wrote:
> 3.5.7.32 -stable review patch.  If anyone has any objections, please let me know.
> 

As requested by Tony Breeds, I'm dropping this from the 3.5 kernel.  Looks
like its applicable only to kernels >= 3.10.

Cheers,
--
Luís

> ------------------
> 
> From: Tony Breeds <tony@...eyournoodle.com>
> 
> commit 41dd03a94c7d408d2ef32530545097f7d1befe5c upstream.
> 
> Currently we're storing a host endian RTAS token in
> rtas_stop_self_args.token.  We then pass that directly to rtas.  This is
> fine on big endian however on little endian the token is not what we
> expect.
> 
> This will typically result in hitting:
> 	panic("Alas, I survived.\n");
> 
> To fix this we always use the stop-self token in host order and always
> convert it to be32 before passing this to rtas.
> 
> Signed-off-by: Tony Breeds <tony@...eyournoodle.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@...nel.crashing.org>
> Signed-off-by: Luis Henriques <luis.henriques@...onical.com>
> ---
>  arch/powerpc/platforms/pseries/hotplug-cpu.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> index 64c97d8..e8f1b00 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
> @@ -34,12 +34,7 @@
>  #include "offline_states.h"
>  
>  /* This version can't take the spinlock, because it never returns */
> -static struct rtas_args rtas_stop_self_args = {
> -	.token = RTAS_UNKNOWN_SERVICE,
> -	.nargs = 0,
> -	.nret = 1,
> -	.rets = &rtas_stop_self_args.args[0],
> -};
> +static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE;
>  
>  static DEFINE_PER_CPU(enum cpu_state_vals, preferred_offline_state) =
>  							CPU_STATE_OFFLINE;
> @@ -92,15 +87,20 @@ void set_default_offline_state(int cpu)
>  
>  static void rtas_stop_self(void)
>  {
> -	struct rtas_args *args = &rtas_stop_self_args;
> +	struct rtas_args args = {
> +		.token = cpu_to_be32(rtas_stop_self_token),
> +		.nargs = 0,
> +		.nret = 1,
> +		.rets = &args.args[0],
> +	};
>  
>  	local_irq_disable();
>  
> -	BUG_ON(args->token == RTAS_UNKNOWN_SERVICE);
> +	BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE);
>  
>  	printk("cpu %u (hwid %u) Ready to die...\n",
>  	       smp_processor_id(), hard_smp_processor_id());
> -	enter_rtas(__pa(args));
> +	enter_rtas(__pa(&args));
>  
>  	panic("Alas, I survived.\n");
>  }
> @@ -383,10 +383,10 @@ static int __init pseries_cpu_hotplug_init(void)
>  		}
>  	}
>  
> -	rtas_stop_self_args.token = rtas_token("stop-self");
> +	rtas_stop_self_token = rtas_token("stop-self");
>  	qcss_tok = rtas_token("query-cpu-stopped-state");
>  
> -	if (rtas_stop_self_args.token == RTAS_UNKNOWN_SERVICE ||
> +	if (rtas_stop_self_token == RTAS_UNKNOWN_SERVICE ||
>  			qcss_tok == RTAS_UNKNOWN_SERVICE) {
>  		printk(KERN_INFO "CPU Hotplug not supported by firmware "
>  				"- disabling.\n");
> -- 
> 1.9.0
> 
--
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