lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220628005611.13106-26-casey@schaufler-ca.com>
Date:   Mon, 27 Jun 2022 17:56:03 -0700
From:   Casey Schaufler <casey@...aufler-ca.com>
To:     casey.schaufler@...el.com, jmorris@...ei.org,
        linux-security-module@...r.kernel.org, selinux@...r.kernel.org
Cc:     casey@...aufler-ca.com, linux-audit@...hat.com,
        keescook@...omium.org, john.johansen@...onical.com,
        penguin-kernel@...ove.sakura.ne.jp, paul@...l-moore.com,
        stephen.smalley.work@...il.com, linux-kernel@...r.kernel.org
Subject: [PATCH v37 25/33] LSM: Add a function to report multiple LSMs

Add a new boolean function lsm_multiple_contexts() to
identify when multiple security modules provide security
context strings.

Signed-off-by: Casey Schaufler <casey@...aufler-ca.com>
Acked-by: Paul Moore <paul@...l-moore.com>
Reviewed-by: John Johansen <john.johansen@...onical.com>
---
 include/linux/security.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/security.h b/include/linux/security.h
index 5ebc3ec6948c..890a5f9f043c 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -245,6 +245,15 @@ static inline const char *lsm_slot_to_name(int slot)
 }
 #endif
 
+static inline bool lsm_multiple_contexts(void)
+{
+#ifdef CONFIG_SECURITY
+	return lsm_slot_to_name(1) != NULL;
+#else
+	return false;
+#endif
+}
+
 /**
  * lsmblob_value - find the first non-zero value in an lsmblob structure.
  * @blob: Pointer to the data
-- 
2.36.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ