diff options
author | 2020-06-11 15:17:57 +0200 | |
---|---|---|
committer | 2020-06-11 15:17:57 +0200 | |
commit | f77d26a9fc525286bcef3d4f98b52e17482cf49c (patch) | |
tree | 6b179c9aa84787773cb601a14a64255e2912154b /include/linux/capability.h | |
parent | EDAC/amd64: Add AMD family 17h model 60h PCI IDs (diff) | |
parent | x86/entry: Unbreak __irqentry_text_start/end magic (diff) | |
download | wireguard-linux-f77d26a9fc525286bcef3d4f98b52e17482cf49c.tar.xz wireguard-linux-f77d26a9fc525286bcef3d4f98b52e17482cf49c.zip |
Merge branch 'x86/entry' into ras/core
to fixup conflicts in arch/x86/kernel/cpu/mce/core.c so MCE specific follow
up patches can be applied without creating a horrible merge conflict
afterwards.
Diffstat (limited to 'include/linux/capability.h')
-rw-r--r-- | include/linux/capability.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h index ecce0f43c73a..b4345b38a6be 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -251,6 +251,15 @@ extern bool privileged_wrt_inode_uidgid(struct user_namespace *ns, const struct extern bool capable_wrt_inode_uidgid(const struct inode *inode, int cap); extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); extern bool ptracer_capable(struct task_struct *tsk, struct user_namespace *ns); +static inline bool perfmon_capable(void) +{ + return capable(CAP_PERFMON) || capable(CAP_SYS_ADMIN); +} + +static inline bool bpf_capable(void) +{ + return capable(CAP_BPF) || capable(CAP_SYS_ADMIN); +} /* audit system wants to get cap info from files as well */ extern int get_vfs_caps_from_disk(const struct dentry *dentry, struct cpu_vfs_cap_data *cpu_caps); |