From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 12 Mar 2026 10:17:51 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w0cAw-00Als9-0W for lore@lore.pengutronix.de; Thu, 12 Mar 2026 10:17:51 +0100 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1w0cAv-0006PY-3G for lore@pengutronix.de; Thu, 12 Mar 2026 10:17:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rTraDuj3r4TjGhbUuIdBFOJiesX+KfSVfCykemb+T4M=; b=mHd9/vEwP1U1aGo3dGnhzkKcvx AOvvsb9sGAq2nd4Db8n+pIl5dkpiuX0194OtaPHmxuq48V2QClYL9sN3UtESlCTZrCfNkDllvRLw8 79jYu4L8d4d+rYiaFEse2M7vfXKMoVBVZ7pjsQukn70005i8mnkiPeha8IwshxMk2yFpgAXUBIDg/ VwjJPFlqkJyRgckJU1Qhifkx3i0McWYgv6RIzKaeJzAyyZxvTRBntTlTVl2lCm3fdr7Epq7Ix0MVO 7DuPqB9IRsQtUYnQ5qMsqxnXVlQirDaiQBWtpMLkv0+4FoCJrvzQ6hCCEGgSn5SmdSFZ03nily2Lc OZgOhI6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0cAJ-0000000DhPF-1t9S; Thu, 12 Mar 2026 09:17:11 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w0cAD-0000000DhNB-12Lj for barebox@lists.infradead.org; Thu, 12 Mar 2026 09:17:07 +0000 Received: from dude06.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::5c]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1w0cA9-00066g-SN; Thu, 12 Mar 2026 10:17:01 +0100 From: Fabian Pflug Date: Thu, 12 Mar 2026 10:16:43 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260312-v2026-02-0-topic-sconfig_console-v1-2-4c3fccafab1e@pengutronix.de> References: <20260312-v2026-02-0-topic-sconfig_console-v1-0-4c3fccafab1e@pengutronix.de> In-Reply-To: <20260312-v2026-02-0-topic-sconfig_console-v1-0-4c3fccafab1e@pengutronix.de> To: BAREBOX Cc: Fabian Pflug X-Mailer: b4 0.14.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260312_021705_290118_F49E6B64 X-CRM114-Status: GOOD ( 12.11 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.9 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: [PATCH 2/4] security: policy: set active policy on boot X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) If init name has been set at compiletime and the policy is available, because it is part of the path, then set the active policy to the policy selected by compiletime. Since this is so early in the bootchain, there is no need to call security_policy_activate, because there should not be any registered callbacks at this moment in time. If no policy could be found, then it will be filled as before by the first call to is_allowed. Signed-off-by: Fabian Pflug --- security/policy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/security/policy.c b/security/policy.c index 85333d9e6f..e2d1b10a78 100644 --- a/security/policy.c +++ b/security/policy.c @@ -235,6 +235,9 @@ static int security_init(void) if (*CONFIG_SECURITY_POLICY_PATH) security_policy_add(default); + if (*CONFIG_SECURITY_POLICY_INIT) + active_policy = security_policy_get(CONFIG_SECURITY_POLICY_INIT); + return 0; } pure_initcall(security_init); -- 2.47.3