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: <20101028160423.GB11953@Krystal>
Date:	Thu, 28 Oct 2010 12:04:23 -0400
From:	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
To:	Jason Baron <jbaron@...hat.com>
Cc:	masami.hiramatsu.pt@...achi.com, hpa@...or.com, tglx@...utronix.de,
	andi@...stfloor.org, fweisbec@...il.com, rostedt@...dmis.org,
	mingo@...e.hu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] call stop_machine_text_poke() on all cpus

* Jason Baron (jbaron@...hat.com) wrote:
> Currently, text_poke_smp() passes a NULL as the third argument to
> __stop_machine(), which will only run stop_machine_text_poke()
> on 1 cpu. Change NULL -> cpu_online_mask, as stop_machine_text_poke()
> is intended to be run on all cpus.
> 
> I actually didn't notice any problems with stop_machine_text_poke()
> only being called on 1 cpu, but found this via code inspection.
> 
> Signed-off-by: Jason Baron <jbaron@...hat.com>

Good catch!

The side-effect of this is that the other CPUs are not executing the
memory barrier and not flushing the icache, as we would normally expect.

Thanks,

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>

> ---
>  arch/x86/kernel/alternative.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 9f39a1c..3c3f26f 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -705,6 +705,6 @@ void *__kprobes text_poke_smp(void *addr, const void *opcode, size_t len)
>  	atomic_set(&stop_machine_first, 1);
>  	wrote_text = 0;
>  	/* Use __stop_machine() because the caller already got online_cpus. */
> -	__stop_machine(stop_machine_text_poke, (void *)&tpp, NULL);
> +	__stop_machine(stop_machine_text_poke, (void *)&tpp, cpu_online_mask);
>  	return addr;
>  }
> -- 
> 1.7.1
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
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