Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp765588imi; Fri, 22 Jul 2022 09:01:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vd2pYek8SSuHa7bXzVhsByLMpZP8OEaqSXLGiVBAI0cCIRTkeVBQKAdg38vfGRLSiM8Wpa X-Received: by 2002:a05:6870:1684:b0:10d:b809:1882 with SMTP id j4-20020a056870168400b0010db8091882mr2233346oae.82.1658505684773; Fri, 22 Jul 2022 09:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658505684; cv=none; d=google.com; s=arc-20160816; b=d9eV3gtrrH5IAEV13INRk3edtRw89ShiPwqc93Be6xQNGsSLSxNEKcsgpJIBcCXipu fWA8rc23ZEa62//3hAXygkemomEBuxXerL3x5fKtabsBJyFyLrV2S/Sap6Mysq3AzYum RiwsxYPCXhBp5dKOBqxKD3H2BwiYkjixClvlewnvsuCQhKbC3TUPf5W89wNxw2oQv1/N 5EA8GwIjqj8Ksy3pVeatpK/G0Hw1rQDf9W0mkF2fjZ+d7pinOc4+u2zK/kAZM+X7YchB LVW/JeKlAUFcrxQm5Sc9s42QWOCKU60wSpN+svb/m1+pY+W77DcIQ0LCuVzjzYGCQtCu n4og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aCLHtbRKshEr19SxgmIqpbKA2q2uOzzLjIQo8W8Trig=; b=AbQALuQIUNo/XLkIbwDUOqn4J6YQhzULj0r9QWntllCobuAx6BB+nAPUzlEOAybJ8x u8R/IX/Jyjp2UM9DcN5ojcTv7678cl1HvHWGc4jADw9OaR7C/JNQ+wU7R+jiNoelIjaK Fyh93a/bfGLDQghF+Noi6K1bdUrcENOdvTkLv157BGpONmJj4DeK3cKXr3YAVuF39Hr+ SvqDendJSMK1YEkOFDMi6mc33GWncNHb4o+5I/1LNovHxKetgkh5276B5sN2nwt7yNj/ ZRAcXd2xDgayVnbSQUqQFCB5J6Xtkp1pmsHg+XjjTk4t103SL7VmGf/0b6UMLPh72ZAG q+ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o7RJwxnI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z19-20020a056808065300b0033a5d06d64fsi3841263oih.136.2022.07.22.09.00.52; Fri, 22 Jul 2022 09:01:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o7RJwxnI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235672AbiGVPRf (ORCPT + 99 others); Fri, 22 Jul 2022 11:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235585AbiGVPRe (ORCPT ); Fri, 22 Jul 2022 11:17:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC9F713E0A; Fri, 22 Jul 2022 08:17:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4736E62155; Fri, 22 Jul 2022 15:17:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F0B4C341C7; Fri, 22 Jul 2022 15:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658503052; bh=jPlHs36zPeUaSc/musyEd34dfiN7dNUrdFQXuCvn1v0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=o7RJwxnIWOilXjEk1yyNHW0M321N+yOFY4bUF08Bme8BE3ALE44JmNqTvgH+0LV2w 6Qt3UE2Ia6P8Mx0P2kK3p0XNm4AJIH8jb5am8QrrFhVpQO2+X9EpLPeGZ+/FDV006Y q2dAR+K0OgVwv+FwebxaRuBPTre2H8A/lDkKNJI4uDEGmgcPlQ8kyHL+ih4YmfVTkJ F/d+vGrWwRHwvlLvjD7kymfZAZiSsomZ4LESTwRKTGSrKy0k49wAVrR5TvAjttMoce HL5xvG6nEGPlLsew9X4Sy/qwfU2D1H5hpRfsaKbXoJ5OWOKe+7sGWwoWTrRtXVk4xa 6Dwzo19VzWvpQ== Received: by mail-ot1-f41.google.com with SMTP id y10-20020a9d634a000000b006167f7ce0c5so3577382otk.0; Fri, 22 Jul 2022 08:17:32 -0700 (PDT) X-Gm-Message-State: AJIora/AiaMqSi5KYYwCG6HaNA8/hwDFe+fq/i3UFRNZ4LbxDovvQmTJ CBRJ3BFve5tcFASV3jTqZAoMbxtcjAkp/GWGPpY= X-Received: by 2002:a9d:2f2a:0:b0:61c:cc5a:22b with SMTP id h39-20020a9d2f2a000000b0061ccc5a022bmr154201otb.71.1658503051701; Fri, 22 Jul 2022 08:17:31 -0700 (PDT) MIME-Version: 1.0 References: <20220721100433.18286-1-lukas.bulwahn@gmail.com> In-Reply-To: <20220721100433.18286-1-lukas.bulwahn@gmail.com> From: Ard Biesheuvel Date: Fri, 22 Jul 2022 17:17:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64: adjust KASLR relocation after ARCH_RANDOM removal To: Lukas Bulwahn Cc: Catalin Marinas , Will Deacon , Linux ARM , "Jason A . Donenfeld" , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Thu, 21 Jul 2022 at 12:04, Lukas Bulwahn wrote: > > Commit aacd149b6238 ("arm64: head: avoid relocating the kernel twice for > KASLR") adds the new file arch/arm64/kernel/pi/kaslr_early.c with a small > code part guarded by '#ifdef CONFIG_ARCH_RANDOM'. > > Concurrently, commit 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM") > removes the config CONFIG_ARCH_RANDOM and turns all '#ifdef > CONFIG_ARCH_RANDOM' code parts into unconditional code parts, which is > generally safe to do. > > Remove a needless ifdef guard after the ARCH_RANDOM removal. > > Signed-off-by: Lukas Bulwahn Acked-by: Ard Biesheuvel > --- > arch/arm64/kernel/pi/kaslr_early.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c > index 6c3855e69395..17bff6e399e4 100644 > --- a/arch/arm64/kernel/pi/kaslr_early.c > +++ b/arch/arm64/kernel/pi/kaslr_early.c > @@ -94,11 +94,9 @@ asmlinkage u64 kaslr_early_init(void *fdt) > > seed = get_kaslr_seed(fdt); > if (!seed) { > -#ifdef CONFIG_ARCH_RANDOM > - if (!__early_cpu_has_rndr() || > - !__arm64_rndr((unsigned long *)&seed)) > -#endif > - return 0; > + if (!__early_cpu_has_rndr() || > + !__arm64_rndr((unsigned long *)&seed)) > + return 0; > } > > /* > -- > 2.17.1 >