From patchwork Thu Oct 4 21:26:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [30/33] x86/alternatives: Fix p6 nops on non-modular kernels Date: Thu, 04 Oct 2012 11:26:52 -0000 From: Greg KH X-Patchwork-Id: 189339 Message-Id: <20121004210602.236827150@linuxfoundation.org> To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Marcelo Tosatti , Michael Tokarev , Borislav Petkov , Tomas Racek , qemu-devel@nongnu.org, Avi Kivity , Anthony Liguori , "H. Peter Anvin" , Ben Jencks , Ingo Molnar , alan@lxorguk.ukuu.org.uk, Alan Cox 3.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Avi Kivity commit cb09cad44f07044d9810f18f6f9a6a6f3771f979 upstream. Probably a leftover from the early days of self-patching, p6nops are marked __initconst_or_module, which causes them to be discarded in a non-modular kernel. If something later triggers patching, it will overwrite kernel code with garbage. Reported-by: Tomas Racek Signed-off-by: Avi Kivity Cc: Michael Tokarev Cc: Borislav Petkov Cc: Marcelo Tosatti Cc: qemu-devel@nongnu.org Cc: Anthony Liguori Cc: H. Peter Anvin Cc: Alan Cox Cc: Alan Cox Link: http://lkml.kernel.org/r/5034AE84.90708@redhat.com Signed-off-by: Ingo Molnar Cc: Ben Jencks Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/alternative.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -161,7 +161,7 @@ static const unsigned char * const k7_no #endif #ifdef P6_NOP1 -static const unsigned char __initconst_or_module p6nops[] = +static const unsigned char p6nops[] = { P6_NOP1, P6_NOP2,