From: Cyrill Gorcunov Date: Thu, 7 Jun 2012 21:21:11 +0000 (-0700) Subject: c/r: prctl: add minimal address test to PR_SET_MM X-Git-Tag: v3.5~221^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ad75b9e16280ca4e2501a629a225319cf2eef2e;p=platform%2Fkernel%2Flinux-amlogic.git c/r: prctl: add minimal address test to PR_SET_MM Make sure the address being set is greater than mmap_min_addr (as suggested by Kees Cook). Signed-off-by: Cyrill Gorcunov Acked-by: Kees Cook Cc: Serge Hallyn Cc: Tejun Heo Cc: Pavel Emelyanov Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sys.c b/kernel/sys.c index 54f20fd..19a2c713 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1869,7 +1869,7 @@ static int prctl_set_mm(int opt, unsigned long addr, if (opt == PR_SET_MM_EXE_FILE) return prctl_set_mm_exe_file(mm, (unsigned int)addr); - if (addr >= TASK_SIZE) + if (addr >= TASK_SIZE || addr < mmap_min_addr) return -EINVAL; error = -EINVAL;