Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp253492rdb; Thu, 30 Nov 2023 04:08:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHEGrjd/37SjmnIDX4MZVgwjj07hTYfAWfA1yfBmvDI6JODEs3HXHrQBgBt0sDC0ZIU3r9Z X-Received: by 2002:a05:6602:13ce:b0:7b3:6d40:536c with SMTP id o14-20020a05660213ce00b007b36d40536cmr27169596iov.7.1701346127210; Thu, 30 Nov 2023 04:08:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701346127; cv=none; d=google.com; s=arc-20160816; b=Gt+/wYF2ZjydMnlZNCuYVORlGvPjd5aOlMXdAFuMVogQnf5VhvSv2//nqdSIDY5P3J ApxK25LoPdONRwr5YjCTcnuGkF1plw2Khki4CQs0d1PIn20TsHj9eOwb7rhNAfZ92IHP 1V2SmZa9HbMVG332+t9CQKgYGtOrs8VMnQqi25Xi77z9lfHLedqEO78NJy2be8vN34AU v1zkJP99JVCfnsjBtB7aJf87HKmjEMsFyozR1MdJI9V+AxL5pt9fCRrxCGQ3jlQprYD3 tPs4ZcibMQiTlIPeB0VFZbano+1m9oyNNjYBgXlRQ6htBv37nXZ6/myYSryg7hYz/VVj qvdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fXPMZud/4qMKPZCD7uWLEjX+yvZbhSmy6NLzEdFPQkA=; fh=GKTWQdtsTNcMx6J5Gq8P9YvHh7TJJnxHNtaIndOIzIU=; b=onhYwy90ePNu7JJkAbSW1hsR7FZRsHpYKcq1i8GVKPbr0RrVgkiWABtVZbMu9yjoZB E/omse3sXjIDNKuBWiQ+GZuTLgx0GV8FIAnsEMtO5gbQIUlFWj+aK0F61mskBIvmP1RQ XMHpne6Bsq+xmDb9Se18jfvllWeo0v7TDkNmiwmyUlbYLJeTBBRfZtspkCMRXgPXx1dd +KRwfRQLWOQ9dXYJBqKy859TTN2fbaLTfeCa3d7V4tFT0Q2qQMeqxOzUVqRGT7jy14U4 iwC00Ru6X+sK3WzxDUKu2vXp8hEsHCi93BCmBONQ2FOWWKIgwuFwdo9rmrqhdgI37iLd BN4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZSYC1tpY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c6-20020a656746000000b005b935872b48si1184080pgu.537.2023.11.30.04.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 04:08:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ZSYC1tpY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1B954809D3E3; Thu, 30 Nov 2023 04:08:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345308AbjK3MId (ORCPT + 99 others); Thu, 30 Nov 2023 07:08:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345246AbjK3MIb (ORCPT ); Thu, 30 Nov 2023 07:08:31 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18525C1 for ; Thu, 30 Nov 2023 04:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fXPMZud/4qMKPZCD7uWLEjX+yvZbhSmy6NLzEdFPQkA=; b=ZSYC1tpYLTtE4qOg8/FfymSkpL e3ngl7iO9PpO5TBjDvQjEfHqq1bQOJSZjmoW7rTKupa7R4vbm3KctCoEbXRCCldsfXih8af2wuvqQ CG2GoVD/PThQRAa/qZao4y2j5zgsrBrkdvJDd4ys06LGpYisCKI4g7D7FDGBVyHNjcQTR80P2IEAp BTX9e6ihNAg6ZAgvcMweGshSjGvpbe97hJQsNOXD3xtOosyLMxWEnTPoWzVVxpMUFFsPmyIsbqUbs 5nwNU581/SMHxDHtdkRiojqudN9qyQEZNZ/S96OokGz0puo8MTXN86ZnmSNHein+v/xyBwzvSyp9z bAOmWO5w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r8fqK-00EQ0c-EH; Thu, 30 Nov 2023 12:08:32 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id C6E3F300293; Thu, 30 Nov 2023 13:08:31 +0100 (CET) Date: Thu, 30 Nov 2023 13:08:31 +0100 From: Peter Zijlstra To: Borislav Petkov Cc: X86 ML , LKML Subject: Re: [RFC PATCH] x86/Kconfig: Disable KASLR on debug builds Message-ID: <20231130120831.GB20153@noisy.programming.kicks-ass.net> References: <20231130120552.6735-1-bp@alien8.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130120552.6735-1-bp@alien8.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 04:08:44 -0800 (PST) On Thu, Nov 30, 2023 at 01:05:52PM +0100, Borislav Petkov wrote: > From: "Borislav Petkov (AMD)" > > Having KASLR enabled makes debugging a kernel completely useless because > virtual addresses are not stable, leading to people poking at kernel > internals to have to go and rebuild with RANDOMIZE_BASE=off. > > Just disable it on debugging builds where it is not needed anyway. Works for me, but I have "nokaslr no_hash_pointers" on all my machines by now. It goes right along with "debug ignore_loglevel sysrq_always_enabled earlyprintk=serial,ttyS0,115200" :-) > Signed-off-by: Borislav Petkov (AMD) > --- > arch/x86/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > index c456c9b1fc7c..da94354b1b75 100644 > --- a/arch/x86/Kconfig > +++ b/arch/x86/Kconfig > @@ -2159,7 +2159,7 @@ config RELOCATABLE > > config RANDOMIZE_BASE > bool "Randomize the address of the kernel image (KASLR)" > - depends on RELOCATABLE > + depends on RELOCATABLE && !DEBUG_KERNEL > default y > help > In support of Kernel Address Space Layout Randomization (KASLR), > -- > 2.42.0.rc0.25.ga82fb66fed25 >