aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/security.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
committerJames Morris <jmorris@namei.org>2008-12-04 01:16:36 -0500
commitec98ce480ada787f2cfbd696980ff3564415505b (patch)
tree1a4d644b38f9f1e4b4e086fde0b195df4a92cf84 /include/linux/security.h
parent3496f92beb9aa99ef21fccc154a36c7698e9c538 (diff)
parentfeaf3848a813a106f163013af6fcf6c4bfec92d9 (diff)
Merge branch 'master' into next
Conflicts: fs/nfsd/nfs4recover.c Manually fixed above to use new creds API functions, e.g. nfs4_save_creds(). Signed-off-by: James Morris <jmorris@namei.org>
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 59a11e19b617..6423abf1ac0f 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1797,17 +1797,21 @@ static inline int security_settime(struct timespec *ts, struct timezone *tz)
1797 1797
1798static inline int security_vm_enough_memory(long pages) 1798static inline int security_vm_enough_memory(long pages)
1799{ 1799{
1800 WARN_ON(current->mm == NULL);
1800 return cap_vm_enough_memory(current->mm, pages); 1801 return cap_vm_enough_memory(current->mm, pages);
1801} 1802}
1802 1803
1803static inline int security_vm_enough_memory_kern(long pages) 1804static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
1804{ 1805{
1805 return cap_vm_enough_memory(current->mm, pages); 1806 WARN_ON(mm == NULL);
1807 return cap_vm_enough_memory(mm, pages);
1806} 1808}
1807 1809
1808static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) 1810static inline int security_vm_enough_memory_kern(long pages)
1809{ 1811{
1810 return cap_vm_enough_memory(mm, pages); 1812 /* If current->mm is a kernel thread then we will pass NULL,
1813 for this specific case that is fine */
1814 return cap_vm_enough_memory(current->mm, pages);
1811} 1815}
1812 1816
1813static inline int security_bprm_set_creds(struct linux_binprm *bprm) 1817static inline int security_bprm_set_creds(struct linux_binprm *bprm)