diff options
Diffstat (limited to 'include/linux/security.h')
| -rw-r--r-- | include/linux/security.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index 63030c85ee19..75f4156c84d7 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -159,6 +159,27 @@ extern int mmap_min_addr_handler(struct ctl_table *table, int write, | |||
| 159 | typedef int (*initxattrs) (struct inode *inode, | 159 | typedef int (*initxattrs) (struct inode *inode, |
| 160 | const struct xattr *xattr_array, void *fs_data); | 160 | const struct xattr *xattr_array, void *fs_data); |
| 161 | 161 | ||
| 162 | |||
| 163 | /* Keep the kernel_load_data_id enum in sync with kernel_read_file_id */ | ||
| 164 | #define __data_id_enumify(ENUM, dummy) LOADING_ ## ENUM, | ||
| 165 | #define __data_id_stringify(dummy, str) #str, | ||
| 166 | |||
| 167 | enum kernel_load_data_id { | ||
| 168 | __kernel_read_file_id(__data_id_enumify) | ||
| 169 | }; | ||
| 170 | |||
| 171 | static const char * const kernel_load_data_str[] = { | ||
| 172 | __kernel_read_file_id(__data_id_stringify) | ||
| 173 | }; | ||
| 174 | |||
| 175 | static inline const char *kernel_load_data_id_str(enum kernel_load_data_id id) | ||
| 176 | { | ||
| 177 | if ((unsigned)id >= LOADING_MAX_ID) | ||
| 178 | return kernel_load_data_str[LOADING_UNKNOWN]; | ||
| 179 | |||
| 180 | return kernel_load_data_str[id]; | ||
| 181 | } | ||
| 182 | |||
| 162 | #ifdef CONFIG_SECURITY | 183 | #ifdef CONFIG_SECURITY |
| 163 | 184 | ||
| 164 | struct security_mnt_opts { | 185 | struct security_mnt_opts { |
| @@ -309,7 +330,7 @@ void security_file_set_fowner(struct file *file); | |||
| 309 | int security_file_send_sigiotask(struct task_struct *tsk, | 330 | int security_file_send_sigiotask(struct task_struct *tsk, |
| 310 | struct fown_struct *fown, int sig); | 331 | struct fown_struct *fown, int sig); |
| 311 | int security_file_receive(struct file *file); | 332 | int security_file_receive(struct file *file); |
| 312 | int security_file_open(struct file *file, const struct cred *cred); | 333 | int security_file_open(struct file *file); |
| 313 | int security_task_alloc(struct task_struct *task, unsigned long clone_flags); | 334 | int security_task_alloc(struct task_struct *task, unsigned long clone_flags); |
| 314 | void security_task_free(struct task_struct *task); | 335 | void security_task_free(struct task_struct *task); |
| 315 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); | 336 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); |
| @@ -320,6 +341,7 @@ void security_cred_getsecid(const struct cred *c, u32 *secid); | |||
| 320 | int security_kernel_act_as(struct cred *new, u32 secid); | 341 | int security_kernel_act_as(struct cred *new, u32 secid); |
| 321 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 342 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
| 322 | int security_kernel_module_request(char *kmod_name); | 343 | int security_kernel_module_request(char *kmod_name); |
| 344 | int security_kernel_load_data(enum kernel_load_data_id id); | ||
| 323 | int security_kernel_read_file(struct file *file, enum kernel_read_file_id id); | 345 | int security_kernel_read_file(struct file *file, enum kernel_read_file_id id); |
| 324 | int security_kernel_post_read_file(struct file *file, char *buf, loff_t size, | 346 | int security_kernel_post_read_file(struct file *file, char *buf, loff_t size, |
| 325 | enum kernel_read_file_id id); | 347 | enum kernel_read_file_id id); |
| @@ -858,8 +880,7 @@ static inline int security_file_receive(struct file *file) | |||
| 858 | return 0; | 880 | return 0; |
| 859 | } | 881 | } |
| 860 | 882 | ||
| 861 | static inline int security_file_open(struct file *file, | 883 | static inline int security_file_open(struct file *file) |
| 862 | const struct cred *cred) | ||
| 863 | { | 884 | { |
| 864 | return 0; | 885 | return 0; |
| 865 | } | 886 | } |
| @@ -909,6 +930,11 @@ static inline int security_kernel_module_request(char *kmod_name) | |||
| 909 | return 0; | 930 | return 0; |
| 910 | } | 931 | } |
| 911 | 932 | ||
| 933 | static inline int security_kernel_load_data(enum kernel_load_data_id id) | ||
| 934 | { | ||
| 935 | return 0; | ||
| 936 | } | ||
| 937 | |||
| 912 | static inline int security_kernel_read_file(struct file *file, | 938 | static inline int security_kernel_read_file(struct file *file, |
| 913 | enum kernel_read_file_id id) | 939 | enum kernel_read_file_id id) |
| 914 | { | 940 | { |
