diff options
Diffstat (limited to 'include/linux/security.h')
-rw-r--r-- | include/linux/security.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/security.h b/include/linux/security.h index f5c4a51eb42e..e3d4ecda2673 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1585,6 +1585,7 @@ int security_syslog(int type); | |||
1585 | int security_settime(struct timespec *ts, struct timezone *tz); | 1585 | int security_settime(struct timespec *ts, struct timezone *tz); |
1586 | int security_vm_enough_memory(long pages); | 1586 | int security_vm_enough_memory(long pages); |
1587 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1587 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
1588 | int security_vm_enough_memory_kern(long pages); | ||
1588 | int security_bprm_alloc(struct linux_binprm *bprm); | 1589 | int security_bprm_alloc(struct linux_binprm *bprm); |
1589 | void security_bprm_free(struct linux_binprm *bprm); | 1590 | void security_bprm_free(struct linux_binprm *bprm); |
1590 | void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); | 1591 | void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); |
@@ -1817,14 +1818,23 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz) | |||
1817 | 1818 | ||
1818 | static inline int security_vm_enough_memory(long pages) | 1819 | static inline int security_vm_enough_memory(long pages) |
1819 | { | 1820 | { |
1821 | WARN_ON(current->mm == NULL); | ||
1820 | return cap_vm_enough_memory(current->mm, pages); | 1822 | return cap_vm_enough_memory(current->mm, pages); |
1821 | } | 1823 | } |
1822 | 1824 | ||
1823 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) | 1825 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
1824 | { | 1826 | { |
1827 | WARN_ON(mm == NULL); | ||
1825 | return cap_vm_enough_memory(mm, pages); | 1828 | return cap_vm_enough_memory(mm, pages); |
1826 | } | 1829 | } |
1827 | 1830 | ||
1831 | static inline int security_vm_enough_memory_kern(long pages) | ||
1832 | { | ||
1833 | /* If current->mm is a kernel thread then we will pass NULL, | ||
1834 | for this specific case that is fine */ | ||
1835 | return cap_vm_enough_memory(current->mm, pages); | ||
1836 | } | ||
1837 | |||
1828 | static inline int security_bprm_alloc(struct linux_binprm *bprm) | 1838 | static inline int security_bprm_alloc(struct linux_binprm *bprm) |
1829 | { | 1839 | { |
1830 | return 0; | 1840 | return 0; |