Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp503302rdb; Thu, 30 Nov 2023 10:11:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/dm95NI5TP4RmwBmpz7XgBcgiWcXvxykcyrhLpSwTvclxpqKJB6dX6l0WAMFOygTtjKaY X-Received: by 2002:a05:6a00:438d:b0:6cd:e3f3:d01f with SMTP id bt13-20020a056a00438d00b006cde3f3d01fmr3580472pfb.26.1701367867796; Thu, 30 Nov 2023 10:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701367867; cv=none; d=google.com; s=arc-20160816; b=y25TED6s4i2req4XgeXVlha9XZaq1OKy3jzywus4qQ2ZyH5NQhrMIHXoTDh+zhfQ/w lb+lCq/PMiaKy0GBlOUHxaUzHiPOHl8HRDDgjVMv5Ea/jBsuP3pg7+RxgHewc0rYzM46 LxgbFGdAb4o48hnHWCHiYQJugVSyiGAdaAj4jLDUbd5e9O7pmpCjc/CBV1XRD1+lTHyC Diduevd/VLV9jGNflwNA9LY9+lgh8v7kAD8gIifUglB95K0HjnRLlms9EjX9uLgVyOjK 2J7zvYkU9ALeM/LmZYCgVwb3jCkjWX/qv8ut8a+d61vkn0hBUe84VBTLRZWjRHb9P7Bs dszQ== 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=k+xbfI8zDlOqQxKgwLK7qKf35k/ByZctyV04FFU4qnM=; fh=GKTWQdtsTNcMx6J5Gq8P9YvHh7TJJnxHNtaIndOIzIU=; b=JcGXygHnJfQaJ7ToZ9qRuD6jaKANw9SUfS/p1PTQ79PiVLh/wbJGBBGKvokBQPbJfQ /p//mTvumJ1OhJIEBLHsDX862ZtnwQmCw0EFSEotPnIeDqc1fRRX/OY0F9JPvwTBuuLN L+Ckj8qsJ9ISq2R+dFhKluMUKi7KiEOYZS7jFNqM/XkrSYujmPanJSMT40q4dRALgCiX WsWv/Dyj6XKA9rrxPNtOeuBA8QFj3AtMkQhKO6AxMJhRsNeAmPFFxvc1gLv1EwtsPlyA NtIyshn2Q+d6QwRsvJ698sL0JHzrmO7wNY2/ylT+WfmWCjLdcHUFkvc9d2dD/5Bz9mnt ns3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q000qmGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s20-20020a056a0008d400b006be1d2ee8f9si1775803pfu.224.2023.11.30.10.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 10:11:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q000qmGa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1B52980268FD; Thu, 30 Nov 2023 10:11:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346708AbjK3SKt (ORCPT + 99 others); Thu, 30 Nov 2023 13:10:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230106AbjK3SKs (ORCPT ); Thu, 30 Nov 2023 13:10:48 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 531C5D50 for ; Thu, 30 Nov 2023 10:10:54 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99AE6C433C8; Thu, 30 Nov 2023 18:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701367853; bh=V6uKp5swnL/aySQKGTAEm30joG3gXQBj6L1/dfwNL+k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q000qmGaH/Ep9K11XVDfrz/oFCNtkM1gYg0VsicONnglf/BybLrUl/DQ4THxPlhF/ eDKU2XS1JJoM5pO3rlyWtA6a/bVX2awA/Y89oFy1tvijwP1K2Mb0lOv5431Tg1eAjb 1B1K0Tl1b79xK8IpamWoxCs22+2NhVVAdERMt5NRfB6L9N3AosN1WtIzUW+U2d3flu UNm5tW4b/u/fqJ1dwa4u3bFUET/aLfl0ZzE4O1FU2UbD5d5WRMoZt6IPoWsKZDA2KX pp33cB50t7BkQluvmXjoSP7QIPZVcyEmCYtKAZ8eyjmAR5qfGOskVprmZWgn5UM6aS 6l6SrhgOB839Q== Date: Thu, 30 Nov 2023 11:10:51 -0700 From: Nathan Chancellor To: Borislav Petkov Cc: X86 ML , LKML Subject: Re: [RFC PATCH] x86/Kconfig: Disable KASLR on debug builds Message-ID: <20231130181051.GA3357088@dev-arch.thelio-3990X> 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=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 10:11:05 -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. > > Signed-off-by: Borislav Petkov (AMD) I know Peter pointed out that there is a runtime switch for this, which should make this patch obsolete but in case there is more reasons needed for why this might be a bad idea, most distribution configurations have CONFIG_DEBUG_KERNEL enabled because CONFIG_EXPERT selects it: archlinux/x86_64.config:CONFIG_DEBUG_KERNEL=y debian/amd64.config:CONFIG_DEBUG_KERNEL=y fedora/x86_64.config:CONFIG_DEBUG_KERNEL=y opensuse/x86_64.config:CONFIG_DEBUG_KERNEL=y > --- > 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 >