From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754235AbdKAKSi (ORCPT ); Wed, 1 Nov 2017 06:18:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:33256 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbdKAKSh (ORCPT ); Wed, 1 Nov 2017 06:18:37 -0400 Date: Wed, 1 Nov 2017 11:18:29 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , "linux-kernel@vger.kernel.org" , Brian Gerst , Dave Hansen , Linus Torvalds Subject: Re: [PATCH 16/18] x86/boot/32: Fix cpu_current_top_of_stack initialization at boot Message-ID: <20171101101828.vtrh2y47zmobqrwj@pd.tnic> References: <6b7a77661e09912eb937032ab289ad28598e2ad5.1509006199.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6b7a77661e09912eb937032ab289ad28598e2ad5.1509006199.git.luto@kernel.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 26, 2017 at 01:26:48AM -0700, Andy Lutomirski wrote: > cpu_current_top_of_stack's initialization forgot about > TOP_OF_KERNEL_STACK_PADDING. This bug didn't matter because the > idle threads never enter user mode. > > Signed-off-by: Andy Lutomirski > --- > arch/x86/kernel/smpboot.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index ad59edd84de7..06c18fe1c09e 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -961,8 +961,7 @@ void common_cpu_up(unsigned int cpu, struct task_struct *idle) > #ifdef CONFIG_X86_32 > /* Stack for startup_32 can be just as for start_secondary onwards */ > irq_ctx_init(cpu); > - per_cpu(cpu_current_top_of_stack, cpu) = > - (unsigned long)task_stack_page(idle) + THREAD_SIZE; > + per_cpu(cpu_current_top_of_stack, cpu) = task_top_of_stack(idle); > #else > initial_gs = per_cpu_offset(cpu); > #endif > -- Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --