prctl: Use access_ok instead of TASK_SIZE in prctl_set_mm
PATCH 1/1 prctl: Use access_ok instead of TASK_SIZE in prctl_set_mm
Eric pointed that better to use access_ok instead of TASK_SIZE for testing if address is allowed for use.
Reported-by "Eric W. Biederman" <[email protected]>
Signed-off-by Cyrill Gorcunov <[email protected]>
CC Mark Salter <[email protected]>
CC Kees Cook <[email protected]>
CC Andrew Morton <[email protected]>
CC Pavel Emelyanov <[email protected]>
--- kernel/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sys.c +1 -1
@@ -1865,7 +1865,7 @@ static int prctl_set_mm(int opt, unsigneif (opt ==PR_SET_MM_EXE_FILE )return prctl_set_mm_exe_file (mm, (unsigned int )addr); -if (addr >=TASK_SIZE || addr < mmap_min_addr) +if (!access_ok (VERIFY_READ , addr,sizeof (addr)) || addr < mmap_min_addr)return -EINVAL ; error = -EINVAL ;