aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Stancek <jstancek@redhat.com>2012-10-01 10:16:29 +0200
committerEric B Munson <emunson@mgebm.net>2012-11-06 08:17:51 -0500
commit64dedcf4eac90c0b35438be9e2ad3bb34f584ed3 (patch)
tree9246f7422f1acfae31333e603afb9f1ded7ee70f
parent03687a4235f9e1bb972dd13f16792e4adf2ebb17 (diff)
downloadlibhugetlbfs-64dedcf4eac90c0b35438be9e2ad3bb34f584ed3.tar.gz
mremap can't extend shared anon memory
mremap-expand-slice-collision mmaps page of shared anon memory, which is then passed to mremap to extend this mapping to two pages: mremap(q, page_size, 2*page_size, 0); The mapping is extended, but backing shmem file is not, so accessing second page always fails with SIGBUS in do_readback(). Signed-off-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Eric B Munson <emunson@mgebm.net>
-rw-r--r--tests/mremap-expand-slice-collision.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/mremap-expand-slice-collision.c b/tests/mremap-expand-slice-collision.c
index 0cbff15..7178c6a 100644
--- a/tests/mremap-expand-slice-collision.c
+++ b/tests/mremap-expand-slice-collision.c
@@ -114,7 +114,7 @@ int main(int argc, char *argv[])
q = mmap((void *)(SLICE_BOUNDARY - page_size), page_size,
PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0);
if (q == MAP_FAILED)
FAIL("mmap(normal below): %s", strerror(errno));