|
Message-ID: <CAE-jjv7YFQBjE1LGy2MGLBPa2enpcysnnrJw+mSkGwJKmupjAA@mail.gmail.com>
Date: Mon, 16 Oct 2017 09:09:32 +0800
From: Minqiang Chen <ptpt52@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH v1] mman: fix mmap pass wrong offset to kernel
Author: Chen Minqiang <ptpt52@...il.com>
Date: Mon Oct 16 08:57:41 2017 +0800
musl: fix mmap pass wrong offset to kernel
for example off_t x=0x8d9eb000, the x/4096 result is 0xfff8d9eb,
not 0x8d9eb as expecting
this happens on arm_cortex-a15 with gcc 6.3.x
Signed-off-by: Chen Minqiang <ptpt52@...il.com>
*diff --git a/src/mman/mmap.c b/src/mman/mmap.c*
*index 1592403..a09c901 100644*
*--- a/src/mman/mmap.c*
*+++ b/src/mman/mmap.c*
*@@ -27,7 +27,7 @@* void *__mmap(void *start, size_t len, int prot, int
flags, int fd, off_t off)
__vm_wait();
}
#ifdef SYS_mmap2
*- ret = __syscall(SYS_mmap2, start, len, prot, flags, fd, off/UNIT);*
*+* *ret = __syscall(SYS_mmap2, start, len, prot, flags, fd,
(unsigned long)off/UNIT);*
#else
ret = __syscall(SYS_mmap, start, len, prot, flags, fd, off);
#endif
Content of type "text/html" skipped
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.