linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] capabilities: remove cap_mmap_file()
@ 2024-09-25 19:20 Paul Moore
  2024-09-25 19:45 ` Casey Schaufler
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Moore @ 2024-09-25 19:20 UTC (permalink / raw)
  To: linux-security-module, serge

The cap_mmap_file() LSM callback returns the default value for the
security_mmap_file() LSM hook and can be safely removed.

Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 security/commoncap.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/security/commoncap.c b/security/commoncap.c
index cefad323a0b1..3d103069903b 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1428,12 +1428,6 @@ int cap_mmap_addr(unsigned long addr)
 	return ret;
 }
 
-int cap_mmap_file(struct file *file, unsigned long reqprot,
-		  unsigned long prot, unsigned long flags)
-{
-	return 0;
-}
-
 #ifdef CONFIG_SECURITY
 
 static const struct lsm_id capability_lsmid = {
@@ -1453,7 +1447,6 @@ static struct security_hook_list capability_hooks[] __ro_after_init = {
 	LSM_HOOK_INIT(inode_killpriv, cap_inode_killpriv),
 	LSM_HOOK_INIT(inode_getsecurity, cap_inode_getsecurity),
 	LSM_HOOK_INIT(mmap_addr, cap_mmap_addr),
-	LSM_HOOK_INIT(mmap_file, cap_mmap_file),
 	LSM_HOOK_INIT(task_fix_setuid, cap_task_fix_setuid),
 	LSM_HOOK_INIT(task_prctl, cap_task_prctl),
 	LSM_HOOK_INIT(task_setscheduler, cap_task_setscheduler),
-- 
2.46.1


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

end of thread, other threads:[~2024-10-02 15:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25 19:20 [RFC PATCH] capabilities: remove cap_mmap_file() Paul Moore
2024-09-25 19:45 ` Casey Schaufler
2024-09-26 13:11   ` Serge E. Hallyn
2024-09-26 13:16     ` Paul Moore
2024-09-26 13:22       ` Serge E. Hallyn
2024-09-26 13:24         ` Paul Moore
2024-09-30 21:08           ` Serge E. Hallyn
2024-10-01 14:08             ` Paul Moore
2024-10-01 21:20               ` Serge E. Hallyn
2024-10-02 15:36                 ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).