mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Fabian Pflug <f.pflug@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>
Cc: Fabian Pflug <f.pflug@pengutronix.de>
Subject: [PATCH v6 4/7] security: policy: add notifier chain for name change
Date: Tue, 24 Mar 2026 10:52:37 +0100	[thread overview]
Message-ID: <20260324-v2026-02-0-topic-sconfig_console-v6-4-f0eb6af2cc06@pengutronix.de> (raw)
In-Reply-To: <20260324-v2026-02-0-topic-sconfig_console-v6-0-f0eb6af2cc06@pengutronix.de>

Add an additional notifier chain, that gets called, whenever a security
policy itself is changed, independent of the policies that have changed,
which could be used to inform users about the currently selected policy
name.

Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
---
 include/security/config.h | 1 +
 security/policy.c         | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/include/security/config.h b/include/security/config.h
index b37ef4272c..35a5e963f7 100644
--- a/include/security/config.h
+++ b/include/security/config.h
@@ -20,6 +20,7 @@ extern const char *sconfig_names[SCONFIG_NUM];
 int sconfig_lookup(const char *name);
 
 extern struct notifier_head sconfig_notifier_list;
+extern struct notifier_head sconfig_name_notifier;
 
 bool is_allowed(const struct security_policy *policy, unsigned option);
 
diff --git a/security/policy.c b/security/policy.c
index fadcca4463..7795d6dfce 100644
--- a/security/policy.c
+++ b/security/policy.c
@@ -47,6 +47,7 @@ static const struct security_policy *active_policy;
 
 static LIST_HEAD(policy_list);
 NOTIFIER_HEAD(sconfig_notifier_list);
+NOTIFIER_HEAD(sconfig_name_notifier);
 
 static bool __is_allowed(const struct security_policy *policy, unsigned option)
 {
@@ -102,6 +103,8 @@ int security_policy_activate(const struct security_policy *policy)
 		notifier_call_chain(&sconfig_notifier_list, i, NULL);
 	}
 
+	notifier_call_chain(&sconfig_name_notifier, 0, NULL);
+
 	return 0;
 }
 

-- 
2.47.3




  parent reply	other threads:[~2026-03-24  9:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  9:52 [PATCH v6 0/7] Add helper for security policies Fabian Pflug
2026-03-24  9:52 ` [PATCH v6 1/7] of: add of_property_write_string_array() Fabian Pflug
2026-03-24  9:52 ` [PATCH v6 2/7] security: policy: sanity check parameters Fabian Pflug
2026-03-24 14:35   ` Ahmad Fatoum
2026-03-24  9:52 ` [PATCH v6 3/7] security: policy: remove global active_policy var Fabian Pflug
2026-03-24  9:52 ` Fabian Pflug [this message]
2026-03-24  9:52 ` [PATCH v6 5/7] common: bootm: add policy to commandline Fabian Pflug
2026-03-24 14:34   ` Ahmad Fatoum
2026-03-24  9:52 ` [PATCH v6 6/7] drivers: pinctrl: configure pinctrl based on policy name Fabian Pflug
2026-03-24  9:52 ` [PATCH v6 7/7] security: kernel_pinctrl: fixup pinctrl in kernel dts Fabian Pflug
2026-03-24 14:57   ` Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260324-v2026-02-0-topic-sconfig_console-v6-4-f0eb6af2cc06@pengutronix.de \
    --to=f.pflug@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox