Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp87116iof; Sun, 5 Jun 2022 21:58:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpklVjUQJPPNKSMqXLvxtEAzCLj7ibNdCG5BhBC6pdW6z62KEjM5OpxaKjNKsRlflUpqUy X-Received: by 2002:a05:6a00:114c:b0:518:c064:d47 with SMTP id b12-20020a056a00114c00b00518c0640d47mr22515332pfm.27.1654491503880; Sun, 05 Jun 2022 21:58:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491503; cv=none; d=google.com; s=arc-20160816; b=k+IWh1ORrmFUDT7upiEiLCAQknS++GcHDcWxEtyovi055ckL1ym3G2+4uw5jv0Ofd4 H7ejjD4Z+d09u3cgXOi3MKsNvkZFzhDb8G3aSwFM9YxOJSIzW0iXicCbwbFt0y85FnGI I1Bc3LmxBICR640LSEFn10lkChzANVXk+DXKQ1f7Gp2NT819j3DbNM9pfgC06R289VUI 5gG0yXt/VlnuI2qKd1wkgylrsGbua3zOE2UPAUTOUT/Xlhct9Gj1J6ZJcd5nNZbAoNyT +sIuLGU9+8lRxxad2yaa2Y6M37bbwAV/1Df19OkYMsyAv2bVT28F6mAsMReEVnXQy5d4 e1nA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=oRsHxHQzO9b36Wu7d91EDPUtT5qXNW3912jYDw/ciis=; b=RqyTXgB9Fx4rjbdMjwzFfawcYJHTwo7VXQcOGVukmEtqlcytplI1WvEYpRJ1VBg7mM KGIvN2UPPq4l6ITRKcIDtzBI1q2G0o6JTy0Ocgn4JR38oCmZHcG8jEw0eiC9wravA0s/ 16IjCzbnKwxYR89KkrZjFRP7oMmJ1kwwmh8cbZuQkBsuE6qYjSB9reMm01pOgDtEKW7Z eVD53aVFvVu22opkvtEcpdculXEZR2DRpwdabHFNwChIhl9qW2YH1PTiSoPlyIb0LDX1 druSmfAiRO8RKpHF6tsaGY4ijLHS9SfiCzMHIHcQs/zQby+UPNVKzNwBGPfSzBTTaHJu RI3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=c3mcp+J+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e66-20020a636945000000b003fb238f91besi19720995pgc.738.2022.06.05.21.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:58:23 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=c3mcp+J+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 54C1C10193F; Sun, 5 Jun 2022 21:11:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243050AbiFCMQK (ORCPT + 99 others); Fri, 3 Jun 2022 08:16:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244222AbiFCMQA (ORCPT ); Fri, 3 Jun 2022 08:16:00 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9238E39B9C; Fri, 3 Jun 2022 05:15:59 -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 ams.source.kernel.org (Postfix) with ESMTPS id 3AEEBB8229C; Fri, 3 Jun 2022 12:15:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3662C385A9; Fri, 3 Jun 2022 12:15:55 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="c3mcp+J+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1654258553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oRsHxHQzO9b36Wu7d91EDPUtT5qXNW3912jYDw/ciis=; b=c3mcp+J+qUuufS2+xBe8Ii9kTqaeIMNB6W/woJj8yZqwjHzz9spVBuRHXD5MyzJIRw+Znw Sv2ZWHqUZu6dNBVJwJq15W+sAGxXcU3gVt5AYH8ICM6+yal0iL4Erteq+dy7pZqFGMp0dt qNk8lOYjQprBB4UmUtI0s4BmkDGCYns= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 2573374e (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 3 Jun 2022 12:15:52 +0000 (UTC) From: "Jason A. Donenfeld" To: linux@armlinux.org.uk, rmk+kernel@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com Cc: "Jason A. Donenfeld" , Stephen Boyd , Ard Biesheuvel , stable@vger.kernel.org Subject: [PATCH v2] ARM: initialize jump labels before setup_machine_fdt() Date: Fri, 3 Jun 2022 14:15:43 +0200 Message-Id: <20220603121543.360283-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Stephen reported that a static key warning splat appears during early boot on arm64 systems that credit randomness from device trees that contain an "rng-seed" property, because setup_machine_fdt() is called before jump_label_init() during setup_arch(), which was fixed by 73e2d827a501 ("arm64: Initialize jump labels before setup_machine_fdt()"). Upon cursory inspection, the same basic issue appears to apply to arm32 as well. So this commit adds a call to jump_label_init() just before setup_machine_fdt(). Reported-by: Stephen Boyd Suggested-by: Ard Biesheuvel Cc: Catalin Marinas Cc: stable@vger.kernel.org Fixes: f5bda35fba61 ("random: use static branch for crng_ready()") Signed-off-by: Jason A. Donenfeld --- arch/arm/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 1e8a50a97edf..3ff80b1ee0b5 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1101,6 +1101,7 @@ void __init setup_arch(char **cmdline_p) atags_vaddr = FDT_VIRT_BASE(__atags_pointer); setup_processor(); + jump_label_init(); if (atags_vaddr) { mdesc = setup_machine_fdt(atags_vaddr); if (mdesc) -- 2.35.1