Skip to content

Commit

Permalink
capabilities: remove cap_mmap_file()
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Serge Hallyn <sergeh@kernel.org>
  • Loading branch information
Paul Moore authored and Serge Hallyn committed Dec 5, 2024
1 parent 40384c8 commit 3f4f1f8
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions security/commoncap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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),
Expand Down

0 comments on commit 3f4f1f8

Please sign in to comment.