aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h50
1 files changed, 41 insertions, 9 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index 3dea6a9d568f..05e88bdcf7d9 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -118,6 +118,7 @@ void reset_security_ops(void);
118extern unsigned long mmap_min_addr; 118extern unsigned long mmap_min_addr;
119extern unsigned long dac_mmap_min_addr; 119extern unsigned long dac_mmap_min_addr;
120#else 120#else
121#define mmap_min_addr 0UL
121#define dac_mmap_min_addr 0UL 122#define dac_mmap_min_addr 0UL
122#endif 123#endif
123 124
@@ -1410,8 +1411,8 @@ struct security_operations {
1410 int (*sb_kern_mount) (struct super_block *sb, int flags, void *data); 1411 int (*sb_kern_mount) (struct super_block *sb, int flags, void *data);
1411 int (*sb_show_options) (struct seq_file *m, struct super_block *sb); 1412 int (*sb_show_options) (struct seq_file *m, struct super_block *sb);
1412 int (*sb_statfs) (struct dentry *dentry); 1413 int (*sb_statfs) (struct dentry *dentry);
1413 int (*sb_mount) (char *dev_name, struct path *path, 1414 int (*sb_mount) (const char *dev_name, struct path *path,
1414 char *type, unsigned long flags, void *data); 1415 const char *type, unsigned long flags, void *data);
1415 int (*sb_umount) (struct vfsmount *mnt, int flags); 1416 int (*sb_umount) (struct vfsmount *mnt, int flags);
1416 int (*sb_pivotroot) (struct path *old_path, 1417 int (*sb_pivotroot) (struct path *old_path,
1417 struct path *new_path); 1418 struct path *new_path);
@@ -1435,7 +1436,7 @@ struct security_operations {
1435 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry,
1436 struct path *new_dir, struct dentry *new_dentry); 1437 struct path *new_dir, struct dentry *new_dentry);
1437 int (*path_chmod) (struct path *path, umode_t mode); 1438 int (*path_chmod) (struct path *path, umode_t mode);
1438 int (*path_chown) (struct path *path, uid_t uid, gid_t gid); 1439 int (*path_chown) (struct path *path, kuid_t uid, kgid_t gid);
1439 int (*path_chroot) (struct path *path); 1440 int (*path_chroot) (struct path *path);
1440#endif 1441#endif
1441 1442
@@ -1693,8 +1694,8 @@ int security_sb_remount(struct super_block *sb, void *data);
1693int security_sb_kern_mount(struct super_block *sb, int flags, void *data); 1694int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
1694int security_sb_show_options(struct seq_file *m, struct super_block *sb); 1695int security_sb_show_options(struct seq_file *m, struct super_block *sb);
1695int security_sb_statfs(struct dentry *dentry); 1696int security_sb_statfs(struct dentry *dentry);
1696int security_sb_mount(char *dev_name, struct path *path, 1697int security_sb_mount(const char *dev_name, struct path *path,
1697 char *type, unsigned long flags, void *data); 1698 const char *type, unsigned long flags, void *data);
1698int security_sb_umount(struct vfsmount *mnt, int flags); 1699int security_sb_umount(struct vfsmount *mnt, int flags);
1699int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1700int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1700int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1701int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
@@ -1963,8 +1964,8 @@ static inline int security_sb_statfs(struct dentry *dentry)
1963 return 0; 1964 return 0;
1964} 1965}
1965 1966
1966static inline int security_sb_mount(char *dev_name, struct path *path, 1967static inline int security_sb_mount(const char *dev_name, struct path *path,
1967 char *type, unsigned long flags, 1968 const char *type, unsigned long flags,
1968 void *data) 1969 void *data)
1969{ 1970{
1970 return 0; 1971 return 0;
@@ -2830,7 +2831,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
2830int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2831int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
2831 struct path *new_dir, struct dentry *new_dentry); 2832 struct path *new_dir, struct dentry *new_dentry);
2832int security_path_chmod(struct path *path, umode_t mode); 2833int security_path_chmod(struct path *path, umode_t mode);
2833int security_path_chown(struct path *path, uid_t uid, gid_t gid); 2834int security_path_chown(struct path *path, kuid_t uid, kgid_t gid);
2834int security_path_chroot(struct path *path); 2835int security_path_chroot(struct path *path);
2835#else /* CONFIG_SECURITY_PATH */ 2836#else /* CONFIG_SECURITY_PATH */
2836static inline int security_path_unlink(struct path *dir, struct dentry *dentry) 2837static inline int security_path_unlink(struct path *dir, struct dentry *dentry)
@@ -2886,7 +2887,7 @@ static inline int security_path_chmod(struct path *path, umode_t mode)
2886 return 0; 2887 return 0;
2887} 2888}
2888 2889
2889static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) 2890static inline int security_path_chown(struct path *path, kuid_t uid, kgid_t gid)
2890{ 2891{
2891 return 0; 2892 return 0;
2892} 2893}
@@ -3021,5 +3022,36 @@ static inline void free_secdata(void *secdata)
3021{ } 3022{ }
3022#endif /* CONFIG_SECURITY */ 3023#endif /* CONFIG_SECURITY */
3023 3024
3025#ifdef CONFIG_SECURITY_YAMA
3026extern int yama_ptrace_access_check(struct task_struct *child,
3027 unsigned int mode);
3028extern int yama_ptrace_traceme(struct task_struct *parent);
3029extern void yama_task_free(struct task_struct *task);
3030extern int yama_task_prctl(int option, unsigned long arg2, unsigned long arg3,
3031 unsigned long arg4, unsigned long arg5);
3032#else
3033static inline int yama_ptrace_access_check(struct task_struct *child,
3034 unsigned int mode)
3035{
3036 return 0;
3037}
3038
3039static inline int yama_ptrace_traceme(struct task_struct *parent)
3040{
3041 return 0;
3042}
3043
3044static inline void yama_task_free(struct task_struct *task)
3045{
3046}
3047
3048static inline int yama_task_prctl(int option, unsigned long arg2,
3049 unsigned long arg3, unsigned long arg4,
3050 unsigned long arg5)
3051{
3052 return -ENOSYS;
3053}
3054#endif /* CONFIG_SECURITY_YAMA */
3055
3024#endif /* ! __LINUX_SECURITY_H */ 3056#endif /* ! __LINUX_SECURITY_H */
3025 3057