Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp409660imi; Thu, 21 Jul 2022 03:37:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNk/sZuAOglD4cbTeBpB4auVQucM/AHMukiMKPRtydTIrmuKEfMFsbWQ7d1u5c13CgHdEl X-Received: by 2002:a17:90b:3841:b0:1ef:f0ac:de55 with SMTP id nl1-20020a17090b384100b001eff0acde55mr10856961pjb.35.1658399853682; Thu, 21 Jul 2022 03:37:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658399853; cv=none; d=google.com; s=arc-20160816; b=LYmLplhC1D4OETNXvhFgyunLcryc7IxIrBZH7RTWSjgG5sCTZHvVoXNbMotKxOoAu4 0URjJA5Sv73VkMD7JnuukO6U9mzLhNQILZpbz/avMfQ2OBGFyj25YXMb/vleqIE8Zdh7 JUOt00NYO+MFwjggU2UWs3wRR1Qi1HoZK5kOMtasoOdnIB1RKR6Z7pTW8fBng24arqBN SDlkxz5Z8uNLDz4peGqXLFcPFMrMLXHMtureiAVg/TIjstF7hlsMrtvcqxVZwTfM/uDd FoFqVhp8/WlW7vKxiDloqrn+erAfsZrzox5NRGB9pqKUMm8a2ftW7rzDMXC4ytUR2M6u sgUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=OmiME2WjuBaxraPUdAySd/nUD3D7/qmdyLuktPj9ZJY=; b=UWkY9wo5syfR/nylLwND7o7JdAmgwS50sZJzJfFzWbD7OHy7DoKt0FcWZeKcMFHTOE pEvMt8oTU/wL2Uk2CCyjxE15WRjEF+tIf3uGcPDffiKa26V/k8ewTJKHv/bRdcIf51Zv rtPICYKUMr04g7pHZ3XCBChB/HRHyCOgpsNLit0+o5PcSWs5gXeJPtytAF7yeykKvnde 2tTKc3B8rknbilkPeqo/BRJMsMJFR1/S+AHeEP+0P7xqk0kHC3gLujfN3wbd+dSGB2GU nL74C5C5rlKJpR2dhI7CrzpNbGEPErT+X5Cg3B7A5n15lD8FBd/kdTWh30suQT9xqDJy KIEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GFCfEGC9; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a63545a000000b004118cff9aabsi1824234pgm.127.2022.07.21.03.37.19; Thu, 21 Jul 2022 03:37:33 -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=@gmail.com header.s=20210112 header.b=GFCfEGC9; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233016AbiGUKEw (ORCPT + 99 others); Thu, 21 Jul 2022 06:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbiGUKEu (ORCPT ); Thu, 21 Jul 2022 06:04:50 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 882A03A4A2; Thu, 21 Jul 2022 03:04:49 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id fy29so2211924ejc.12; Thu, 21 Jul 2022 03:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=OmiME2WjuBaxraPUdAySd/nUD3D7/qmdyLuktPj9ZJY=; b=GFCfEGC9t+Rf8CxbPXrlDDDL7mAzykWfdZPlI+fBTNr+n5dMUjsf+tuC24l4EUTRQV uYZxZMIUnKZ/dYK3Ys4b321ivYvsrZY8mdP7ERI/6fNcxjKxT85hVvUPIf9ofBm/imUR lLMrICWUCs04Kbu9tvpI3CGz23i3O1fwyikYJaYhalXGpIGwndbd+mISslCl2GAGS529 oT4DDCkVyqe+s0EOcYDc/8xg8mCwsyjW2usVFuUiZBa+C1AJDGovrqcQlGvjiYu/aTdi NQtkB352wwNcOH7Df9yYjD+qq17DItb4Zcq3UJL0EvV99y/VciaFhTTVSEZJWLADepqT xtBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OmiME2WjuBaxraPUdAySd/nUD3D7/qmdyLuktPj9ZJY=; b=d6bMXEGvyaEmNaZ7+ebkiujRO53HPrHsAgzhAWwgXLz3VPUouskTveqPUBAHxyZbVQ 3UGy/YlI9gq7P2/IkxmdvomymNW95cP4SE7GYhLVxaYwGnrGPz6IRPuji0mYgcYGRago QfN3H4UEEOBw3/PWSU9qZLZouXy6FIQ68713h3Qx8uuz/Lsd0+L3mnIyNx9buuVoI7Bz xVIrWTdPscS5FN8Sf2uS8SEqVMG9agBn0RPAUoGmpdb/1LGufCpkFwDNmMl4s0BWKyn1 0k2Cxuzgp/dlf8PZmVCIg1ZcOzr3J1ZBermdcsx2m4QLuJBj5eVkmz7o6fB3uMgKmB8T ZAIg== X-Gm-Message-State: AJIora9teqrNhMH/flri8g8zm6t04K6DbtfFYGZuVpbtZk0cxVou55w+ NnJcbf6eGAFRWpm1M5/CiDI= X-Received: by 2002:a17:907:3f29:b0:72b:91df:2c4b with SMTP id hq41-20020a1709073f2900b0072b91df2c4bmr39434382ejc.206.1658397887935; Thu, 21 Jul 2022 03:04:47 -0700 (PDT) Received: from felia.fritz.box (200116b826c37500a4adcf8f67474f65.dip.versatel-1u1.de. [2001:16b8:26c3:7500:a4ad:cf8f:6747:4f65]) by smtp.gmail.com with ESMTPSA id d12-20020a50fe8c000000b0043a554818afsm713684edt.42.2022.07.21.03.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 03:04:47 -0700 (PDT) From: Lukas Bulwahn To: Ard Biesheuvel , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Cc: "Jason A . Donenfeld" , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH] arm64: adjust KASLR relocation after ARCH_RANDOM removal Date: Thu, 21 Jul 2022 12:04:33 +0200 Message-Id: <20220721100433.18286-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 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 --- 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