summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-07-02 08:49:35 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-07-02 08:49:35 -0700
commitbc75ac4f1dcec256a65b531e2d5be84f5b0fe6bc (patch)
tree10721936b043630c95f2e6686379c02bf7176e79 /fs/exec.c
parentcee396e281fc2c8a55261eea1a89a594e98f3e0f (diff)
[PATCH] Security hook for vm_enough_memory
From: Stephen Smalley <sds@epoch.ncsc.mil> This patch against 2.5.73 replaces vm_enough_memory with a security hook per Alan Cox's suggestion so that security modules can completely replace the logic if desired. Note that the patch changes the interface to follow the convention of the other security hooks, i.e. return 0 if ok or -errno on failure (-ENOMEM in this case) rather than returning a boolean. It also exports various variables and functions required for the vm_enough_memory logic.
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 204d0a3a1565..f91b25952248 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -392,7 +392,7 @@ int setup_arg_pages(struct linux_binprm *bprm)
if (!mpnt)
return -ENOMEM;
- if (!vm_enough_memory((STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
+ if (security_vm_enough_memory((STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) {
kmem_cache_free(vm_area_cachep, mpnt);
return -ENOMEM;
}