diff mbox series

[02/10] mm: Export copy_to_kernel_nofault()

Message ID 20221102171025.126961-2-penguin-kernel@I-love.SAKURA.ne.jp (mailing list archive)
State Rejected
Delegated to: Paul Moore
Headers show
Series [01/10] security: Export security_hook_heads | expand

Commit Message

Tetsuo Handa Nov. 2, 2022, 5:10 p.m. UTC
LSM modules which can be loaded using /sbin/insmod need to be able to
modify security_hook_heads. Since security_hook_heads might be read-only
due to being marked as __lsm_ro_after_init, and writing to read-only memory
crashes the kernel, such LSM modules need to test whether memory pages
containing security_hook_heads is read-only.

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

Patch

diff --git a/mm/maccess.c b/mm/maccess.c
index 5f4d240f67ec..f75447b13034 100644
--- a/mm/maccess.c
+++ b/mm/maccess.c
@@ -75,6 +75,7 @@  long copy_to_kernel_nofault(void *dst, const void *src, size_t size)
 	pagefault_enable();
 	return -EFAULT;
 }
+EXPORT_SYMBOL_GPL(copy_to_kernel_nofault);
 
 long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count)
 {