Skip to contentSkip to conversation

LSM: SafeSetID: Mark safesetid_initialized as __initdata

PATCH In review Austin Kim 2 participants 3 messages Jun 8, 2021 – Jun 10, 2021

Subsystems (2)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 LSM: SafeSetID: Mark safesetid_initialized as __initdata

Mark safesetid_initialized as __initdata since it is only used in initialization routine.

---
 security/safesetid/lsm.c | 2 +-
 security/safesetid/lsm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/safesetid/lsm.c +1 -1
index 1079c6d54784..963f4ad9cb66 100644
@@ -22,7 +22,7 @@
 #include "lsm.h"
 
 /* Flag indicating whether initialization completed */
-int safesetid_initialized;
+int safesetid_initialized __initdata;
 
 struct setid_ruleset __rcu *safesetid_setuid_rules;
 struct setid_ruleset __rcu *safesetid_setgid_rules;
security/safesetid/lsm.h +1 -1
index bde8c43a3767..d346f4849cea 100644
@@ -19,7 +19,7 @@
 #include <linux/hashtable.h>
 
 /* Flag indicating whether initialization completed */
-extern int safesetid_initialized;
+extern int safesetid_initialized __initdata;
 
 enum sid_policy_type {
 	SIDPOL_DEFAULT, /* source ID is unaffected by policy */
Signature · 1 line
2.20.1
maintainer
#1 lore raw

Thanks for the patch. Looks right, since that variable is only used in safesetid_security_init() and safesetid_init_securityfs(), which are both marked __init. I can merge it to the safesetid-next branch today and send the patch through my tree during the 5.14 merge window.

Quoted 39 lines · Austin Kim

Mark safesetid_initialized as __initdata since it is only used in initialization routine.

---
 security/safesetid/lsm.c | 2 +-
 security/safesetid/lsm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/safesetid/lsm.c +1 -1
index 1079c6d54784..963f4ad9cb66 100644
@@ -22,7 +22,7 @@
 #include "lsm.h"
 
 /* Flag indicating whether initialization completed */
-int safesetid_initialized;
+int safesetid_initialized __initdata;
 
 struct setid_ruleset __rcu *safesetid_setuid_rules;
 struct setid_ruleset __rcu *safesetid_setgid_rules;
security/safesetid/lsm.h +1 -2
index bde8c43a3767..d346f4849cea 100644
@@ -19,7 +19,7 @@
 #include <linux/hashtable.h>
 
 /* Flag indicating whether initialization completed */
-extern int safesetid_initialized;
+extern int safesetid_initialized __initdata;
 
 enum sid_policy_type {
        SIDPOL_DEFAULT, /* source ID is unaffected by policy */
--

2.20.1

author
#2 lore raw

2021년 6월 11일 (금) 오전 1:50, Micah Morton <[email protected]>님이 작성:

Quoted 5 lines

Thanks for the patch. Looks right, since that variable is only used in safesetid_security_init() and safesetid_init_securityfs(), which are both marked __init. I can merge it to the safesetid-next branch today and send the patch through my tree during the 5.14 merge window.

Great. Thanks!

Quoted 41 lines · Austin Kim
Quoted 39 lines

Mark safesetid_initialized as __initdata since it is only used in initialization routine.

---
 security/safesetid/lsm.c | 2 +-
 security/safesetid/lsm.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/safesetid/lsm.c +1 -1
index 1079c6d54784..963f4ad9cb66 100644
@@ -22,7 +22,7 @@
 #include "lsm.h"
 
 /* Flag indicating whether initialization completed */
-int safesetid_initialized;
+int safesetid_initialized __initdata;
 
 struct setid_ruleset __rcu *safesetid_setuid_rules;
 struct setid_ruleset __rcu *safesetid_setgid_rules;
security/safesetid/lsm.h +1 -2
index bde8c43a3767..d346f4849cea 100644
@@ -19,7 +19,7 @@
 #include <linux/hashtable.h>
 
 /* Flag indicating whether initialization completed */
-extern int safesetid_initialized;
+extern int safesetid_initialized __initdata;
 
 enum sid_policy_type {
        SIDPOL_DEFAULT, /* source ID is unaffected by policy */
--

2.20.1