cregit-Linux how code gets into the kernel

Release 4.15 security/security.c

Directory: security
/*
 * Security plug functions
 *
 * Copyright (C) 2001 WireX Communications, Inc <chris@wirex.com>
 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
 * Copyright (C) 2016 Mellanox Technologies
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 */

#include <linux/bpf.h>
#include <linux/capability.h>
#include <linux/dcache.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/lsm_hooks.h>
#include <linux/integrity.h>
#include <linux/ima.h>
#include <linux/evm.h>
#include <linux/fsnotify.h>
#include <linux/mman.h>
#include <linux/mount.h>
#include <linux/personality.h>
#include <linux/backing-dev.h>
#include <linux/string.h>
#include <net/flow.h>


#define MAX_LSM_EVM_XATTR	2

/* Maximum number of letters for an LSM name string */

#define SECURITY_NAME_MAX	10


struct security_hook_heads security_hook_heads __lsm_ro_after_init;
static ATOMIC_NOTIFIER_HEAD(lsm_notifier_chain);


char *lsm_names;
/* Boot-time LSM user choice */

static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
	CONFIG_DEFAULT_SECURITY;


static void __init do_security_initcalls(void) { initcall_t *call; call = __security_initcall_start; while (call < __security_initcall_end) { (*call) (); call++; } }

Contributors

PersonTokensPropCommitsCommitProp
Chris Wright34100.00%1100.00%
Total34100.00%1100.00%

/** * security_init - initializes the security framework * * This should be called early in the kernel initialization sequence. */
int __init security_init(void) { int i; struct list_head *list = (struct list_head *) &security_hook_heads; for (i = 0; i < sizeof(security_hook_heads) / sizeof(struct list_head); i++) INIT_LIST_HEAD(&list[i]); pr_info("Security Framework initialized\n"); /* * Load minor LSMs, with the capability module always first. */ capability_add_hooks(); yama_add_hooks(); loadpin_add_hooks(); /* * Load all the remaining security modules. */ do_security_initcalls(); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Tetsuo Handa4761.04%111.11%
Greg Kroah-Hartman1418.18%222.22%
Casey Schaufler56.49%111.11%
Kees Cook56.49%222.22%
Chris Wright56.49%222.22%
James Morris11.30%111.11%
Total77100.00%9100.00%

/* Save user chosen LSM */
static int __init choose_lsm(char *str) { strncpy(chosen_lsm, str, SECURITY_NAME_MAX); return 1; }

Contributors

PersonTokensPropCommitsCommitProp
Ahmed S. Darwish23100.00%1100.00%
Total23100.00%1100.00%

__setup("security=", choose_lsm);
static bool match_last_lsm(const char *list, const char *lsm) { const char *last; if (WARN_ON(!list || !lsm)) return false; last = strrchr(list, ','); if (last) /* Pass the comma, strcmp() will check for '\0' */ last++; else last = list; return !strcmp(last, lsm); }

Contributors

PersonTokensPropCommitsCommitProp
Mickaël Salaün66100.00%1100.00%
Total66100.00%1100.00%


static int lsm_append(char *new, char **result) { char *cp; if (*result == NULL) { *result = kstrdup(new, GFP_KERNEL); } else { /* Check if it is the last registered name */ if (match_last_lsm(*result, new)) return 0; cp = kasprintf(GFP_KERNEL, "%s,%s", *result, new); if (cp == NULL) return -ENOMEM; kfree(*result); *result = cp; } return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Casey Schaufler7984.95%150.00%
Mickaël Salaün1415.05%150.00%
Total93100.00%2100.00%

/** * security_module_enable - Load given security module on boot ? * @module: the name of the module * * Each LSM must pass this method before registering its own operations * to avoid security registration races. This method may also be used * to check if your LSM is currently loaded during kernel initialization. * * Returns: * * true if: * * - The passed LSM is the one chosen by user at boot time, * - or the passed LSM is configured as the default and the user did not * choose an alternate LSM at boot time. * * Otherwise, return false. */
int __init security_module_enable(const char *module) { return !strcmp(module, chosen_lsm); }

Contributors

PersonTokensPropCommitsCommitProp
Ahmed S. Darwish1470.00%133.33%
Casey Schaufler420.00%133.33%
Tetsuo Handa210.00%133.33%
Total20100.00%3100.00%

/** * security_add_hooks - Add a modules hooks to the hook lists. * @hooks: the hooks to add * @count: the number of hooks to add * @lsm: the name of the security module * * Each LSM has to register its hooks with the infrastructure. */
void __init security_add_hooks(struct security_hook_list *hooks, int count, char *lsm) { int i; for (i = 0; i < count; i++) { hooks[i].lsm = lsm; list_add_tail_rcu(&hooks[i].list, hooks[i].head); } if (lsm_append(lsm, &lsm_names) < 0) panic("%s - Cannot get early memory.\n", __func__); }

Contributors

PersonTokensPropCommitsCommitProp
Casey Schaufler82100.00%1100.00%
Total82100.00%1100.00%


int call_lsm_notifier(enum lsm_event event, void *data) { return atomic_notifier_call_chain(&lsm_notifier_chain, event, data); }

Contributors

PersonTokensPropCommitsCommitProp
Daniel Jurgens24100.00%1100.00%
Total24100.00%1100.00%

EXPORT_SYMBOL(call_lsm_notifier);
int register_lsm_notifier(struct notifier_block *nb) { return atomic_notifier_chain_register(&lsm_notifier_chain, nb); }

Contributors

PersonTokensPropCommitsCommitProp
Daniel Jurgens19100.00%1100.00%
Total19100.00%1100.00%

EXPORT_SYMBOL(register_lsm_notifier);
int unregister_lsm_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&lsm_notifier_chain, nb); }

Contributors

PersonTokensPropCommitsCommitProp
Daniel Jurgens19100.00%1100.00%
Total19100.00%1100.00%

EXPORT_SYMBOL(unregister_lsm_notifier); /* * Hook list operation macros. * * call_void_hook: * This is a hook that does not return a value. * * call_int_hook: * This is a hook that returns a value. */ #define call_void_hook(FUNC, ...) \ do { \ struct security_hook_list *P; \ \ list_for_each_entry(P, &security_hook_heads.FUNC, list) \ P->hook.FUNC(__VA_ARGS__); \ } while (0) #define call_int_hook(FUNC, IRC, ...) ({ \ int RC = IRC; \ do { \ struct security_hook_list *P; \ \ list_for_each_entry(P, &security_hook_heads.FUNC, list) { \ RC = P->hook.FUNC(__VA_ARGS__); \ if (RC != 0) \ break; \ } \ } while (0); \ RC; \ }) /* Security operations */
int security_binder_set_context_mgr(struct task_struct *mgr) { return call_int_hook(binder_set_context_mgr, 0, mgr); }

Contributors

PersonTokensPropCommitsCommitProp
Stephen D. Smalley1575.00%150.00%
Casey Schaufler525.00%150.00%
Total20100.00%2100.00%


int security_binder_transaction(struct task_struct *from, struct task_struct *to) { return call_int_hook(binder_transaction, 0, from, to); }

Contributors

PersonTokensPropCommitsCommitProp
Stephen D. Smalley2281.48%150.00%
Casey Schaufler518.52%150.00%
Total27100.00%2100.00%


int security_binder_transfer_binder(struct task_struct *from, struct task_struct *to) { return call_int_hook(binder_transfer_binder, 0, from, to); }

Contributors

PersonTokensPropCommitsCommitProp
Stephen D. Smalley2281.48%150.00%
Casey Schaufler518.52%150.00%
Total27100.00%2100.00%


int security_binder_transfer_file(struct task_struct *from, struct task_struct *to, struct file *file) { return call_int_hook(binder_transfer_file, 0, from, to, file); }

Contributors

PersonTokensPropCommitsCommitProp
Stephen D. Smalley2985.29%150.00%
Casey Schaufler514.71%150.00%
Total34100.00%2100.00%


int security_ptrace_access_check(struct task_struct *child, unsigned int mode) { return call_int_hook(ptrace_access_check, 0, child, mode); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1246.15%120.00%
Stephen D. Smalley623.08%120.00%
Casey Schaufler519.23%120.00%
Greg Kroah-Hartman27.69%120.00%
Ingo Molnar13.85%120.00%
Total26100.00%5100.00%


int security_ptrace_traceme(struct task_struct *parent) { return call_int_hook(ptrace_traceme, 0, parent); }

Contributors

PersonTokensPropCommitsCommitProp
David Howells1575.00%150.00%
Casey Schaufler525.00%150.00%
Total20100.00%2100.00%


int security_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted) { return call_int_hook(capget, 0, target, effective, inheritable, permitted); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris3181.58%133.33%
Casey Schaufler513.16%133.33%
Greg Kroah-Hartman25.26%133.33%
Total38100.00%3100.00%


int security_capset(struct cred *new, const struct cred *old, const kernel_cap_t *effective, const kernel_cap_t *inheritable, const kernel_cap_t *permitted) { return call_int_hook(capset, 0, new, old, effective, inheritable, permitted); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris2551.02%120.00%
David Howells1734.69%240.00%
Casey Schaufler510.20%120.00%
Greg Kroah-Hartman24.08%120.00%
Total49100.00%5100.00%


int security_capable(const struct cred *cred, struct user_namespace *ns, int cap) { return call_int_hook(capable, 0, cred, ns, cap, SECURITY_CAP_AUDIT); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris925.71%116.67%
Serge E. Hallyn720.00%116.67%
Chris Wright617.14%116.67%
Casey Schaufler514.29%116.67%
Eric Paris514.29%116.67%
David Howells38.57%116.67%
Total35100.00%6100.00%


int security_capable_noaudit(const struct cred *cred, struct user_namespace *ns, int cap) { return call_int_hook(capable, 0, cred, ns, cap, SECURITY_CAP_NOAUDIT); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris1851.43%233.33%
Serge E. Hallyn720.00%116.67%
Casey Schaufler514.29%116.67%
James Morris38.57%116.67%
David Howells25.71%116.67%
Total35100.00%6100.00%


int security_quotactl(int cmds, int type, int id, struct super_block *sb) { return call_int_hook(quotactl, 0, cmds, type, id, sb); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris3085.71%150.00%
Casey Schaufler514.29%150.00%
Total35100.00%2100.00%


int security_quota_on(struct dentry *dentry) { return call_int_hook(quota_on, 0, dentry); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1575.00%150.00%
Casey Schaufler525.00%150.00%
Total20100.00%2100.00%


int security_syslog(int type) { return call_int_hook(syslog, 0, type); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1372.22%150.00%
Casey Schaufler527.78%150.00%
Total18100.00%2100.00%


int security_settime64(const struct timespec64 *ts, const struct timezone *tz) { return call_int_hook(settime, 0, ts, tz); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris2068.97%125.00%
Casey Schaufler517.24%125.00%
Baolin Wang26.90%125.00%
Richard Cochran26.90%125.00%
Total29100.00%4100.00%


int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) { struct security_hook_list *hp; int cap_sys_admin = 1; int rc; /* * The module will respond with a positive value if * it thinks the __vm_enough_memory() call should be * made with the cap_sys_admin set. If all of the modules * agree that it should be set it will. If any module * thinks it should not be set it won't. */ list_for_each_entry(hp, &security_hook_heads.vm_enough_memory, list) { rc = hp->hook.vm_enough_memory(mm, pages); if (rc <= 0) { cap_sys_admin = 0; break; } } return __vm_enough_memory(mm, pages, cap_sys_admin); }

Contributors

PersonTokensPropCommitsCommitProp
Casey Schaufler4764.38%250.00%
Alan Cox1419.18%125.00%
James Morris1216.44%125.00%
Total73100.00%4100.00%


int security_bprm_set_creds(struct linux_binprm *bprm) { return call_int_hook(bprm_set_creds, 0, bprm); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1470.00%133.33%
Casey Schaufler525.00%133.33%
David Howells15.00%133.33%
Total20100.00%3100.00%


int security_bprm_check(struct linux_binprm *bprm) { int ret; ret = call_int_hook(bprm_check_security, 0, bprm); if (ret) return ret; return ima_bprm_check(bprm); }

Contributors

PersonTokensPropCommitsCommitProp
Mimi Zohar1848.65%120.00%
James Morris1129.73%120.00%
Casey Schaufler513.51%120.00%
David Howells38.11%240.00%
Total37100.00%5100.00%


void security_bprm_committing_creds(struct linux_binprm *bprm) { call_void_hook(bprm_committing_creds, bprm); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1270.59%125.00%
Casey Schaufler317.65%125.00%
David Howells15.88%125.00%
Hannes Eder15.88%125.00%
Total17100.00%4100.00%


void security_bprm_committed_creds(struct linux_binprm *bprm) { call_void_hook(bprm_committed_creds, bprm); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1164.71%125.00%
Casey Schaufler317.65%125.00%
David Howells211.76%125.00%
Hannes Eder15.88%125.00%
Total17100.00%4100.00%


int security_sb_alloc(struct super_block *sb) { return call_int_hook(sb_alloc_security, 0, sb); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1575.00%150.00%
Casey Schaufler525.00%150.00%
Total20100.00%2100.00%


void security_sb_free(struct super_block *sb) { call_void_hook(sb_free_security, sb); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1482.35%150.00%
Casey Schaufler317.65%150.00%
Total17100.00%2100.00%


int security_sb_copy_data(char *orig, char *copy) { return call_int_hook(sb_copy_data, 0, orig, copy); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1872.00%133.33%
Casey Schaufler520.00%133.33%
Eric Paris28.00%133.33%
Total25100.00%3100.00%

EXPORT_SYMBOL(security_sb_copy_data);
int security_sb_remount(struct super_block *sb, void *data) { return call_int_hook(sb_remount, 0, sb, data); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris2180.77%150.00%
Casey Schaufler519.23%150.00%
Total26100.00%2100.00%


int security_sb_kern_mount(struct super_block *sb, int flags, void *data) { return call_int_hook(sb_kern_mount, 0, sb, flags, data); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris2683.87%266.67%
Casey Schaufler516.13%133.33%
Total31100.00%3100.00%


int security_sb_show_options(struct seq_file *m, struct super_block *sb) { return call_int_hook(sb_show_options, 0, m, sb); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris2281.48%150.00%
Casey Schaufler518.52%150.00%
Total27100.00%2100.00%


int security_sb_statfs(struct dentry *dentry) { return call_int_hook(sb_statfs, 0, dentry); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1575.00%150.00%
Casey Schaufler525.00%150.00%
Total20100.00%2100.00%


int security_sb_mount(const char *dev_name, const struct path *path, const char *type, unsigned long flags, void *data) { return call_int_hook(sb_mount, 0, dev_name, path, type, flags, data); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris3676.60%120.00%
Al Viro612.77%360.00%
Casey Schaufler510.64%120.00%
Total47100.00%5100.00%


int security_sb_umount(struct vfsmount *mnt, int flags) { return call_int_hook(sb_umount, 0, mnt, flags); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris2080.00%150.00%
Casey Schaufler520.00%150.00%
Total25100.00%2100.00%


int security_sb_pivotroot(const struct path *old_path, const struct path *new_path) { return call_int_hook(sb_pivotroot, 0, old_path, new_path); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1655.17%125.00%
Al Viro827.59%250.00%
Casey Schaufler517.24%125.00%
Total29100.00%4100.00%


int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts, unsigned long kern_flags, unsigned long *set_kern_flags) { return call_int_hook(sb_set_mnt_opts, opts->num_mnt_opts ? -EOPNOTSUPP : 0, sb, opts, kern_flags, set_kern_flags); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris2246.81%240.00%
David Quigley1327.66%120.00%
Casey Schaufler1225.53%240.00%
Total47100.00%5100.00%

EXPORT_SYMBOL(security_sb_set_mnt_opts);
int security_sb_clone_mnt_opts(const struct super_block *oldsb, struct super_block *newsb, unsigned long kern_flags, unsigned long *set_kern_flags) { return call_int_hook(sb_clone_mnt_opts, 0, oldsb, newsb, kern_flags, set_kern_flags); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris2048.78%125.00%
Scott Mayhew1331.71%125.00%
Casey Schaufler512.20%125.00%
Jeff Layton37.32%125.00%
Total41100.00%4100.00%

EXPORT_SYMBOL(security_sb_clone_mnt_opts);
int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) { return call_int_hook(sb_parse_opts_str, 0, options, opts); }

Contributors

PersonTokensPropCommitsCommitProp
Eric Paris2180.77%150.00%
Casey Schaufler519.23%150.00%
Total26100.00%2100.00%

EXPORT_SYMBOL(security_sb_parse_opts_str);
int security_inode_alloc(struct inode *inode) { inode->i_security = NULL; return call_int_hook(inode_alloc_security, 0, inode); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris2076.92%133.33%
Casey Schaufler519.23%133.33%
Eric Paris13.85%133.33%
Total26100.00%3100.00%


void security_inode_free(struct inode *inode) { integrity_inode_free(inode); call_void_hook(inode_free_security, inode); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris1463.64%125.00%
Mimi Zohar522.73%250.00%
Casey Schaufler313.64%125.00%
Total22100.00%4100.00%


int security_dentry_init_security(struct dentry *dentry, int mode, const struct qstr *name, void **ctx, u32 *ctxlen) { return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, name, ctx, ctxlen); }

Contributors

PersonTokensPropCommitsCommitProp
David Quigley4085.11%125.00%
Casey Schaufler612.77%250.00%
Al Viro12.13%125.00%
Total47100.00%4100.00%

EXPORT_SYMBOL(security_dentry_init_security);
int security_dentry_create_files_as(struct dentry *dentry, int mode, struct qstr *name, const struct cred *old, struct cred *new) { return call_int_hook(dentry_create_files_as, 0, dentry, mode, name, old, new); }

Contributors

PersonTokensPropCommitsCommitProp
Vivek Goyal47100.00%1100.00%
Total47100.00%1100.00%

EXPORT_SYMBOL(security_dentry_create_files_as);
int security_inode_init_security(struct inode *inode, struct inode *dir, const struct qstr *qstr, const initxattrs initxattrs, void *fs_data) { struct xattr new_xattrs[MAX_LSM_EVM_XATTR + 1]; struct xattr *lsm_xattr, *evm_xattr, *xattr; int ret; if (unlikely(IS_PRIVATE(inode))) return 0; if (!initxattrs) return call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr, NULL, NULL, NULL); memset(new_xattrs, 0, sizeof(new_xattrs)); lsm_xattr = new_xattrs; ret = call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr, &lsm_xattr->name, &lsm_xattr->value, &lsm_xattr->value_len); if (ret) goto out; evm_xattr = lsm_xattr + 1; ret = evm_inode_init_security(inode, lsm_xattr, evm_xattr); if (ret) goto out; ret = initxattrs(inode, new_xattrs, fs_data); out: for (xattr = new_xattrs; xattr->value != NULL; xattr++) kfree(xattr->value); return (ret == -EOPNOTSUPP) ? 0 : ret; }

Contributors

PersonTokensPropCommitsCommitProp
Mimi Zohar17279.63%333.33%
Tetsuo Handa136.02%111.11%
James Morris136.02%111.11%
Casey Schaufler104.63%222.22%
Eric Paris62.78%111.11%
Jan Beulich20.93%111.11%
Total216100.00%9100.00%

EXPORT_SYMBOL(security_inode_init_security);
int security_old_inode_init_security(struct inode *inode, struct inode *dir, const struct qstr *qstr, const char **name, void **value, size_t *len) { if (unlikely(IS_PRIVATE(inode))) return -EOPNOTSUPP; return call_int_hook(inode_init_security, -EOPNOTSUPP, inode, dir, qstr, name, value, len); }

Contributors

PersonTokensPropCommitsCommitProp
James Morris4157.75%114.29%
Mimi Zohar1926.76%114.29%
Casey Schaufler45.63%114.29%
Jan Kara22.82%114.29%
Eric Paris22.82%114.29%
Jan Beulich22.82%114.29%
Tetsuo Handa11.41%114.29%
Total71100.00%7100.00%

EXPORT_SYMBOL(security_old_inode_init_security); #ifdef CONFIG_SECURITY_PATH
int security_path_mknod(const struct path *dir, struct dentry *dentry, umode_t mode, unsigned int dev) { if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) return 0; return call_int_hook(path_mknod, 0, dir, dentry, mode, dev); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda4477.19%116.67%
Casey Schaufler58.77%116.67%
Tetsuo Handa35.26%116.67%
David Howells35.26%116.67%
Al Viro23.51%233.33%
Total57100.00%6100.00%

EXPORT_SYMBOL(security_path_mknod);
int security_path_mkdir(const struct path *dir, struct dentry *dentry, umode_t mode) { if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) return 0; return call_int_hook(path_mkdir, 0, dir, dentry, mode); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda3874.51%116.67%
Casey Schaufler59.80%116.67%
Tetsuo Handa35.88%116.67%
David Howells35.88%116.67%
Al Viro23.92%233.33%
Total51100.00%6100.00%

EXPORT_SYMBOL(security_path_mkdir);
int security_path_rmdir(const struct path *dir, struct dentry *dentry) { if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) return 0; return call_int_hook(path_rmdir, 0, dir, dentry); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda3473.91%120.00%
Casey Schaufler510.87%120.00%
David Howells36.52%120.00%
Tetsuo Handa36.52%120.00%
Al Viro12.17%120.00%
Total46100.00%5100.00%


int security_path_unlink(const struct path *dir, struct dentry *dentry) { if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) return 0; return call_int_hook(path_unlink, 0, dir, dentry); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda3473.91%120.00%
Casey Schaufler510.87%120.00%
Tetsuo Handa36.52%120.00%
David Howells36.52%120.00%
Al Viro12.17%120.00%
Total46100.00%5100.00%

EXPORT_SYMBOL(security_path_unlink);
int security_path_symlink(const struct path *dir, struct dentry *dentry, const char *old_name) { if (unlikely(IS_PRIVATE(d_backing_inode(dir->dentry)))) return 0; return call_int_hook(path_symlink, 0, dir, dentry, old_name); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda4177.36%120.00%
Casey Schaufler59.43%120.00%
Tetsuo Handa35.66%120.00%
David Howells35.66%120.00%
Al Viro11.89%120.00%
Total53100.00%5100.00%


int security_path_link(struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry) { if (unlikely(IS_PRIVATE(d_backing_inode(old_dentry)))) return 0; return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda4282.35%125.00%
Casey Schaufler59.80%125.00%
David Howells35.88%125.00%
Al Viro11.96%125.00%
Total51100.00%4100.00%


int security_path_rename(const struct path *old_dir, struct dentry *old_dentry, const struct path *new_dir, struct dentry *new_dentry, unsigned int flags) { if (unlikely(IS_PRIVATE(d_backing_inode(old_dentry)) || (d_is_positive(new_dentry) && IS_PRIVATE(d_backing_inode(new_dentry))))) return 0; if (flags & RENAME_EXCHANGE) { int err = call_int_hook(path_rename, 0, new_dir, new_dentry, old_dir, old_dentry); if (err) return err; } return call_int_hook(path_rename, 0, old_dir, old_dentry, new_dir, new_dentry); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda5852.25%116.67%
Miklos Szeredi3228.83%233.33%
Casey Schaufler109.01%116.67%
David Howells98.11%116.67%
Al Viro21.80%116.67%
Total111100.00%6100.00%

EXPORT_SYMBOL(security_path_rename);
int security_path_truncate(const struct path *path) { if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) return 0; return call_int_hook(path_truncate, 0, path); }

Contributors

PersonTokensPropCommitsCommitProp
Kentaro Takeda3076.92%125.00%
Casey Schaufler512.82%125.00%
David Howells37.69%125.00%
Al Viro12.56%125.00%
Total39100.00%4100.00%


int security_path_chmod(const struct path *path, umode_t mode) { if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) return 0; return call_int_hook(path_chmod, 0, path, mode); }

Contributors

PersonTokensPropCommitsCommitProp
Tetsuo Handa2965.91%116.67%
Al Viro715.91%350.00%
Casey Schaufler511.36%116.67%
David Howells36.82%116.67%
Total44100.00%6100.00%


int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) { if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) return 0; return call_int_hook(path_chown