Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBA39C433FE for ; Wed, 24 Nov 2021 12:21:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244406AbhKXMXa (ORCPT ); Wed, 24 Nov 2021 07:23:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:48892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243530AbhKXMSS (ORCPT ); Wed, 24 Nov 2021 07:18:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24A1661153; Wed, 24 Nov 2021 12:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637755893; bh=KtonEn5HvGcYC394V97oFTNdYEp6zGgCSACTXwtaPNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r3SiNJ1iBYd4Jbi68hmcC99/7LS0+u0Uri2Veyabrnu4eDUyiawvwtP0q3XHwote7 fBAhk9TBlcNp5Av46k3KtzGBakEdHyiSe/UJsjoX+Fj0CcgjCwvGMqAau8tBTZeSEK bf1cI05MRFNLoeost0bjLj3zt4ZL8jP3hLjTxLOQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Wang , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 4.9 063/207] x86: Increase exception stack sizes Date: Wed, 24 Nov 2021 12:55:34 +0100 Message-Id: <20211124115705.965579826@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115703.941380739@linuxfoundation.org> References: <20211124115703.941380739@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Zijlstra [ Upstream commit 7fae4c24a2b84a66c7be399727aca11e7a888462 ] It turns out that a single page of stack is trivial to overflow with all the tracing gunk enabled. Raise the exception stacks to 2 pages, which is still half the interrupt stacks, which are at 4 pages. Reported-by: Michael Wang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YUIO9Ye98S5Eb68w@hirez.programming.kicks-ass.net Signed-off-by: Sasha Levin --- arch/x86/include/asm/page_64_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index 390fdd39e0e21..5a69eee673536 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -19,7 +19,7 @@ #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) #define CURRENT_MASK (~(THREAD_SIZE - 1)) -#define EXCEPTION_STACK_ORDER (0 + KASAN_STACK_ORDER) +#define EXCEPTION_STACK_ORDER (1 + KASAN_STACK_ORDER) #define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER) #define DEBUG_STACK_ORDER (EXCEPTION_STACK_ORDER + 1) -- 2.33.0