Thread (3 messages) 3 messages, 3 authors, 2016-03-01

linux-next: Unable to write into a vma if it has been mapped without PROT_READ

From: Andrey Wagin <hidden>
Date: 2016-02-29 19:11:39
Also in: linux-mm

Hello Everyone,

I found that now we can't write into a vma if it was mapped without PROT_READ:

mmap(NULL, 4096, PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f2ac7eb8000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7f2ac7eb8000} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault
[root@linux-next-test ~]# cat test.c
#include <sys/mman.h>
#include <stdlib.h>

int main()
{
    int *p;

    p = mmap(NULL, 4096, PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
    p[0] = 1;

    return 0;
}

[root@linux-next-test ~]# uname -a
Linux linux-next-test 4.5.0-rc6-next-20160229 #1 SMP Mon Feb 29
17:38:25 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

This issue appeared in 4.5.0-rc5-next-20160226.

https://ci.openvz.org/job/CRIU-linux-next/152/console

Thanks,
Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help