The address should be bigger than dac_mmap_min_addr, because
a process with CAP_RAWIO can map a vma bellow mmap_min_addr.

Cc: Andrew Morton <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: James Morris <[email protected]>
Signed-off-by: Andrey Vagin <[email protected]>
---
 kernel/sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 265b376..e0e1bbd 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1868,7 +1868,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 || addr < mmap_min_addr)
+       if (addr >= TASK_SIZE || addr < dac_mmap_min_addr)
                return -EINVAL;
 
        error = -EINVAL;
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to