Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp821510pxb; Tue, 9 Nov 2021 00:20:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAJNeyUXkcop6/9MVrgW9TUzVV0F51dfYZCwyCAfWBaOM+g/36kPUZ/Aay9MbRf1BhMpsM X-Received: by 2002:a17:906:e115:: with SMTP id gj21mr7191159ejb.348.1636446012888; Tue, 09 Nov 2021 00:20:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636446012; cv=none; d=google.com; s=arc-20160816; b=nzZqx9NPzXun/kaggtX3w/7C9Ceykdzm+OMKfI69k1t0NJNfuuMBotN8MjyitQZeeF Bmvox4f9glSYj4xrP1k1uiRRAvjgNrkj22/aPW/QsHnN/dKHQFUo1dQ6ULvlwacRdRoa AP8bbRVTYKNJq2bOXDl4wTKNwn3Q0Iz0v2rIcwk/AR0Gy6Znd6nOR1oTCQmhIsXe8Fo3 6MtGqbCzDoSsW4G89B6R5+4wv9xwUjRhtMFjckrvMJXudn/zBPw/MgxUYDsMqmm3OiMp 0wQgG+rc3Jw2NIg0AC58jndRiDY8lSGLndEs9nVdn6Svfj09cu8Lmhu1najg/aNdOM4i tnWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AVtUp+fqYOHaMJWT3GnxEx39xJ00uFqodVZ+XJvufNk=; b=SBA0c8Qc1NstEQvWafJL7Hoh7TEm7lgLcZ2oR7af4RLwltdEKd3+MSycVEqkJ9E9CC wFI8eNpZT38rf1cDhh2M8BfhmwgTY25CRqqEKT20S1M4lGHgc/8JKCxDchluOGql7Kfv IsZVE5nPkSUvgNZ4HoE/6S7eHAVUk2xI96wov3EL6wOSkTJGTBJlBtPp2GnOU3/+iOzq 1YEGGf+typwLhEskseYqUy7RiGLNiVrisGsPnf8YbixPAPYoN2CGHW1bZ0pVuPpWMX9O SL+v4QQLrx+hayQMpS0ePtCA2ThgfFysPf3sOcSP9azny4uQzzeWNxjpv07LacsnnHa/ 4n0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jiOGqrFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nc37si40164168ejc.119.2021.11.09.00.19.49; Tue, 09 Nov 2021 00:20:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jiOGqrFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241658AbhKIBDq (ORCPT + 99 others); Mon, 8 Nov 2021 20:03:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:59710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241625AbhKIBDR (ORCPT ); Mon, 8 Nov 2021 20:03:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4CC286134F; Tue, 9 Nov 2021 01:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636419632; bh=TvmCK6lQ2hlYhAva3GZM/grX/Nr5WqkWiEZe0gfSME4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jiOGqrFChLg/QzutIVWMs8CATacnR7PfS0IKRnz7O9IXXIVa+Z2nEVhwjhW6j7B0B hSWb3kCILQBSfZsgbRcev7uB/3KY1k1DxZmsXZ4Bc9FR5Q6JCpxYTLxMuGfb5pKoAi OiXrW8woozTKGJJ2kdqVgc/PL89gLLAPs+edk+fDrFGVgQQ0KCR/ZHrVzQllFQcMmA OwZ4cjzAsW9sXzPcrf5x63KtU1Ddb1y7TVkOll0V2gKFG5PeLN0dZYkLA2Q+OLKv01 U0Tu0sZOR1WRCCNd0JssGAlus4FjqqYVUD7rT/1VuQiD+2sJn1nftIPd6foWeSrTQp B5qwJWes/9Lkg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peter Zijlstra , Michael Wang , Sasha Levin , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, luto@kernel.org, adobriyan@gmail.com Subject: [PATCH AUTOSEL 5.15 023/146] x86: Increase exception stack sizes Date: Mon, 8 Nov 2021 12:42:50 -0500 Message-Id: <20211108174453.1187052-23-sashal@kernel.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211108174453.1187052-1-sashal@kernel.org> References: <20211108174453.1187052-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 a8d4ad8565681..e9e2c3ba59239 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h @@ -15,7 +15,7 @@ #define THREAD_SIZE_ORDER (2 + KASAN_STACK_ORDER) #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) -#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 IRQ_STACK_ORDER (2 + KASAN_STACK_ORDER) -- 2.33.0