aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-12 06:43:05 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-12 06:43:05 -0500
commit81444a799550214f549caf579cf65a0ca55e70b7 (patch)
tree3288dac0740be2e1e7d1af4ee51d792a6e91edf3 /include/linux/security.h
parenta64d31baed104be25305e9c71585d3ea4ee9a418 (diff)
parentda485e0cb16726797e99a595a399b9fc721b91bc (diff)
Merge branch 'tracing/fastboot' into cpus4096
Diffstat (limited to 'include/linux/security.h')
-rw-r--r--include/linux/security.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/security.h b/include/linux/security.h
index c13f1cec9abb..e3d4ecda2673 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1818,17 +1818,21 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
1818 1818
1819static inline int security_vm_enough_memory(long pages) 1819static inline int security_vm_enough_memory(long pages)
1820{ 1820{
1821 WARN_ON(current->mm == NULL);
1821 return cap_vm_enough_memory(current->mm, pages); 1822 return cap_vm_enough_memory(current->mm, pages);
1822} 1823}
1823 1824
1824static inline int security_vm_enough_memory_kern(long pages) 1825static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1825{ 1826{
1826 return cap_vm_enough_memory(current->mm, pages); 1827 WARN_ON(mm == NULL);
1828 return cap_vm_enough_memory(mm, pages);
1827} 1829}
1828 1830
1829static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) 1831static inline int security_vm_enough_memory_kern(long pages)
1830{ 1832{
1831 return cap_vm_enough_memory(mm, pages); 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);
1832} 1836}
1833 1837
1834static inline int security_bprm_alloc(struct linux_binprm *bprm) 1838static inline int security_bprm_alloc(struct linux_binprm *bprm)