diff options
Diffstat (limited to 'include/linux/security.h')
| -rw-r--r-- | include/linux/security.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index c11dc8aa0351..1a15526e9f67 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -54,7 +54,7 @@ extern int cap_inode_removexattr(struct dentry *dentry, char *name); | |||
| 54 | extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); | 54 | extern int cap_task_post_setuid (uid_t old_ruid, uid_t old_euid, uid_t old_suid, int flags); |
| 55 | extern void cap_task_reparent_to_init (struct task_struct *p); | 55 | extern void cap_task_reparent_to_init (struct task_struct *p); |
| 56 | extern int cap_syslog (int type); | 56 | extern int cap_syslog (int type); |
| 57 | extern int cap_vm_enough_memory (long pages); | 57 | extern int cap_vm_enough_memory (struct mm_struct *mm, long pages); |
| 58 | 58 | ||
| 59 | struct msghdr; | 59 | struct msghdr; |
| 60 | struct sk_buff; | 60 | struct sk_buff; |
| @@ -1125,6 +1125,7 @@ struct request_sock; | |||
| 1125 | * Return 0 if permission is granted. | 1125 | * Return 0 if permission is granted. |
| 1126 | * @vm_enough_memory: | 1126 | * @vm_enough_memory: |
| 1127 | * Check permissions for allocating a new virtual mapping. | 1127 | * Check permissions for allocating a new virtual mapping. |
| 1128 | * @mm contains the mm struct it is being added to. | ||
| 1128 | * @pages contains the number of pages. | 1129 | * @pages contains the number of pages. |
| 1129 | * Return 0 if permission is granted. | 1130 | * Return 0 if permission is granted. |
| 1130 | * | 1131 | * |
| @@ -1169,7 +1170,7 @@ struct security_operations { | |||
| 1169 | int (*quota_on) (struct dentry * dentry); | 1170 | int (*quota_on) (struct dentry * dentry); |
| 1170 | int (*syslog) (int type); | 1171 | int (*syslog) (int type); |
| 1171 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1172 | int (*settime) (struct timespec *ts, struct timezone *tz); |
| 1172 | int (*vm_enough_memory) (long pages); | 1173 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
| 1173 | 1174 | ||
| 1174 | int (*bprm_alloc_security) (struct linux_binprm * bprm); | 1175 | int (*bprm_alloc_security) (struct linux_binprm * bprm); |
| 1175 | void (*bprm_free_security) (struct linux_binprm * bprm); | 1176 | void (*bprm_free_security) (struct linux_binprm * bprm); |
| @@ -1469,10 +1470,14 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz) | |||
| 1469 | return security_ops->settime(ts, tz); | 1470 | return security_ops->settime(ts, tz); |
| 1470 | } | 1471 | } |
| 1471 | 1472 | ||
| 1472 | |||
| 1473 | static inline int security_vm_enough_memory(long pages) | 1473 | static inline int security_vm_enough_memory(long pages) |
| 1474 | { | 1474 | { |
| 1475 | return security_ops->vm_enough_memory(pages); | 1475 | return security_ops->vm_enough_memory(current->mm, pages); |
| 1476 | } | ||
| 1477 | |||
| 1478 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) | ||
| 1479 | { | ||
| 1480 | return security_ops->vm_enough_memory(mm, pages); | ||
| 1476 | } | 1481 | } |
| 1477 | 1482 | ||
| 1478 | static inline int security_bprm_alloc (struct linux_binprm *bprm) | 1483 | static inline int security_bprm_alloc (struct linux_binprm *bprm) |
| @@ -2219,7 +2224,12 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz) | |||
| 2219 | 2224 | ||
| 2220 | static inline int security_vm_enough_memory(long pages) | 2225 | static inline int security_vm_enough_memory(long pages) |
| 2221 | { | 2226 | { |
| 2222 | return cap_vm_enough_memory(pages); | 2227 | return cap_vm_enough_memory(current->mm, pages); |
| 2228 | } | ||
| 2229 | |||
| 2230 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) | ||
| 2231 | { | ||
| 2232 | return cap_vm_enough_memory(mm, pages); | ||
| 2223 | } | 2233 | } |
| 2224 | 2234 | ||
| 2225 | static inline int security_bprm_alloc (struct linux_binprm *bprm) | 2235 | static inline int security_bprm_alloc (struct linux_binprm *bprm) |
