diff options
| author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-05 15:27:43 +1100 |
|---|---|---|
| committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-05 15:27:43 +1100 |
| commit | 14d676f56fad26fd3c31eeff5d4ef8ea4a163571 (patch) | |
| tree | 5e740c5931daecf44a6e74c230f2deb291290f4b /include/linux/security.h | |
| parent | 797eaed40e1df4a3b9ece6894a71ce2b568bca38 (diff) | |
| parent | feaf3848a813a106f163013af6fcf6c4bfec92d9 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/linux/security.h')
| -rw-r--r-- | include/linux/security.h | 12 |
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) static inline int security_vm_enough_memory(long pages) { + WARN_ON(current->mm == NULL); return cap_vm_enough_memory(current->mm, pages); } -static inline int security_vm_enough_memory_kern(long pages) +static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) { - return cap_vm_enough_memory(current->mm, pages); + WARN_ON(mm == NULL); + return cap_vm_enough_memory(mm, pages); } -static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) +static inline int security_vm_enough_memory_kern(long pages) { - return cap_vm_enough_memory(mm, pages); + /* If current->mm is a kernel thread then we will pass NULL, + for this specific case that is fine */ + return cap_vm_enough_memory(current->mm, pages); } static inline int security_bprm_alloc(struct linux_binprm *bprm) |
