Skip to contentSkip to conversation

selinux: log about VM being executable by default

RFC PATCH Superseded Christian Göttsche 2 participants 2 messages Jul 20, 2023 SELinux security module

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 selinux: log about VM being executable by default

In case virtual memory is being marked as executable by default, SELinux checks regarding explicit potential dangerous use are disabled.

Inform the user about it.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
security/selinux/hooks.c +2 -0
index 6f53fa71fbdb..3a7ece84c2cc 100644
@@ -7265,6 +7265,8 @@ static __init int selinux_init(void)
 	cred_init_security();
 
 	default_noexec = !(VM_DATA_DEFAULT_FLAGS & VM_EXEC);
+	if (!default_noexec)
+		pr_notice("SELinux:  virtual memory is executable by default - related checks disabled\n");
 
 	avc_init();
 
Signature · 1 line
2.40.1
maintainer
#1 lore raw
Quoted 16 lines · Christian Göttsche

In case virtual memory is being marked as executable by default, SELinux checks regarding explicit potential dangerous use are disabled.

Inform the user about it.

---
 security/selinux/hooks.c | 2 ++
 1 file changed, 2 insertions(+)
security/selinux/hooks.c +0 -0
index 6f53fa71fbdb..3a7ece84c2cc 100644

security/selinux/hooks.c static __init int selinux_init(void) · line 7269

Quoted 5 lines
security/selinux/hooks.c +2 -0
@@ -7265,6 +7265,8 @@ static __init int selinux_init(void)
        cred_init_security();
 
        default_noexec = !(VM_DATA_DEFAULT_FLAGS & VM_EXEC);
+       if (!default_noexec)
+               pr_notice("SELinux:  virtual memory is executable by default - related checks disabled\n");

Let's keep things concise and simply say that "virtual memory is executable by default", dropping the last part about "related checks".

Quoted 5 lines
security/selinux/hooks.c +0 -1
        avc_init();
 
--

2.40.1

Signature · 1 line
paul-moore.com