diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-12-13 07:17:29 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-12-14 07:16:51 -0800 |
commit | fd6062ede31963a1a10a77e66582a795ecff9ba1 (patch) | |
tree | 7f57f424f5f60a6cc895184935721c2bc09bae06 | |
parent | 0884724a95b60452ad483dbe086d237d02ba624d (diff) | |
download | glibc-fd6062ede31963a1a10a77e66582a795ecff9ba1.tar.gz glibc-fd6062ede31963a1a10a77e66582a795ecff9ba1.tar.xz glibc-fd6062ede31963a1a10a77e66582a795ecff9ba1.zip |
elf: Align argument of __munmap to page size [BZ #28676]
On Linux/x86-64, for elf/tst-align3, we now get munmap(0x7f88f9401000, 1126424) = 0 instead of munmap(0x7f1615200018, 544768) = -1 EINVAL (Invalid argument) Reviewed-by: Florian Weimer <fweimer@redhat.com>
-rw-r--r-- | elf/dl-map-segments.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/elf/dl-map-segments.h b/elf/dl-map-segments.h index 70a4c40695..54e606aa87 100644 --- a/elf/dl-map-segments.h +++ b/elf/dl-map-segments.h @@ -55,6 +55,7 @@ _dl_map_segment (const struct loadcmd *c, ElfW(Addr) mappref, if (delta) __munmap ((void *) map_start, delta); ElfW(Addr) map_end = map_start_aligned + maplength; + map_end = ALIGN_UP (map_end, GLRO(dl_pagesize)); delta = map_start + maplen - map_end; if (delta) __munmap ((void *) map_end, delta); |