All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] security: Export security_hook_heads
@ 2022-11-02 17:10 Tetsuo Handa
  2022-11-02 17:10 ` [PATCH 02/10] mm: Export copy_to_kernel_nofault() Tetsuo Handa
                   ` (8 more replies)
  0 siblings, 9 replies; 28+ messages in thread
From: Tetsuo Handa @ 2022-11-02 17:10 UTC (permalink / raw)
  To: linux-security-module, Casey Schaufler, Paul Moore,
	John Johansen, Kees Cook
  Cc: Tetsuo Handa

LSM modules which can be loaded using /sbin/insmod need to be able to
access security_hook_heads, for security_add_hooks() is marked as __init
function which cannot be accessed from loadable kernel modules.

LSM modules which can be loaded using /sbin/insmod are developed in order
to make it possible to enable LSM modules without replacing or rebuilding
the whole kernel, for distributors disable LSM modules which they cannot
afford supporting via kernel config options while users cannot afford
enabling LSM modules which they want to use by replacing or rebuilding
the whole kernel.

Now that I'm demonstrating CaitSith as one of such LSM modules, export
the security_hook_heads list.

Unlike introducing a LSM manager module which could provide ability to
load/unload loadable LSM modules, exporting only security_hook_heads does
not affect performance of built-in LSM modules and will little increase
the kernel size. Therefore, no kernel config option for this change.

Distributors who believe that loadable LSM modules are unacceptable might
try to make it harder to use loadable LSM modules via unexporting
security_hook_heads. But we cannot hide security_hook_heads perfectly, for
binary code analysis allows loadable kernel modules to identify the
address of security_hook_heads. It is just a matter of cleanness of code.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 security/security.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/security/security.c b/security/security.c
index 79d82cb6e469..fd7b9b1f8348 100644
--- a/security/security.c
+++ b/security/security.c
@@ -75,6 +75,7 @@ const char *const lockdown_reasons[LOCKDOWN_CONFIDENTIALITY_MAX+1] = {
 };
 
 struct security_hook_heads security_hook_heads __lsm_ro_after_init;
+EXPORT_SYMBOL_GPL(security_hook_heads);
 static BLOCKING_NOTIFIER_HEAD(blocking_lsm_notifier_chain);
 
 static struct kmem_cache *lsm_file_cache;
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2022-11-10  4:45 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 17:10 [PATCH 01/10] security: Export security_hook_heads Tetsuo Handa
2022-11-02 17:10 ` [PATCH 02/10] mm: Export copy_to_kernel_nofault() Tetsuo Handa
2022-11-02 17:10 ` [PATCH 03/10] fs,kernel: Export d_absolute_path()/find_task_by_pid_ns()/find_task_by_vpid() Tetsuo Handa
2022-11-05 23:51   ` Serge E. Hallyn
2022-11-02 17:10 ` [PATCH 04/10] CaitSith: Add header file Tetsuo Handa
2022-11-02 17:57   ` Casey Schaufler
2022-11-05  2:43     ` Serge E. Hallyn
2022-11-05  4:05       ` Tetsuo Handa
2022-11-05 23:46         ` Serge E. Hallyn
2022-11-06  0:56           ` Tetsuo Handa
2022-11-07 18:59             ` Casey Schaufler
2022-11-08 10:18               ` Tetsuo Handa
2022-11-09  2:20                 ` Paul Moore
2022-11-09 10:13                   ` Tetsuo Handa
2022-11-09 14:48                     ` Paul Moore
2022-11-09 23:57                       ` Tetsuo Handa
2022-11-10  2:22                         ` Kees Cook
2022-11-10  4:10                           ` Tetsuo Handa
2022-11-10  4:45                             ` Paul Moore
2022-11-07 19:22         ` Paul Moore
2022-11-02 17:10 ` [PATCH 05/10] CaitSith: Add LSM interface management file Tetsuo Handa
2022-11-02 19:05   ` Kees Cook
2022-11-02 17:10 ` [PATCH 07/10] CaitSith: Add permission checking functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 08/10] CaitSith: Add pathname calculation functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 09/10] CaitSith: Add garbage collector functions Tetsuo Handa
2022-11-02 17:10 ` [PATCH 10/10] CaitSith: Add Kconfig and Makefile files Tetsuo Handa
     [not found] ` <20221102171025.126961-6-penguin-kernel@I-love.SAKURA.ne.jp>
2022-11-02 17:29   ` [PATCH 6a/10] CaitSith: Add policy management functions Tetsuo Handa
2022-11-02 17:29   ` [PATCH 6b/10] " Tetsuo Handa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.