This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.25-198-g9ace469
- From: ldv at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 10 Apr 2017 00:39:58 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.25-198-g9ace469
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 9ace4692b2fa96c1c92177bb51e5e36680de25ad (commit)
from bf7730194fed694a9ce821c306683266a5a7b78b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9ace4692b2fa96c1c92177bb51e5e36680de25ad
commit 9ace4692b2fa96c1c92177bb51e5e36680de25ad
Author: Dmitry V. Levin <ldv@altlinux.org>
Date: Wed Nov 16 22:49:25 2016 +0000
Check for __mprotect failure in _dl_map_segments [BZ #20831]
* elf/dl-map-segments.h (_dl_map_segments): Check for failure
of __mprotect to change protection on the excess portion
to disallow all access.
diff --git a/ChangeLog b/ChangeLog
index b72d521..b7c2baf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-04-09 Dmitry V. Levin <ldv@altlinux.org>
+
+ [BZ #20831]
+ * elf/dl-map-segments.h (_dl_map_segments): Check for failure
+ of __mprotect to change protection on the excess portion
+ to disallow all access.
+
2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/fpu/fclrexcpt.c (__feclearexcept): Use
diff --git a/elf/dl-map-segments.h b/elf/dl-map-segments.h
index 31d6861..d36f9bd 100644
--- a/elf/dl-map-segments.h
+++ b/elf/dl-map-segments.h
@@ -64,14 +64,18 @@ _dl_map_segments (struct link_map *l, int fd,
l->l_addr = l->l_map_start - c->mapstart;
if (has_holes)
- /* Change protection on the excess portion to disallow all access;
- the portions we do not remap later will be inaccessible as if
- unallocated. Then jump into the normal segment-mapping loop to
- handle the portion of the segment past the end of the file
- mapping. */
- __mprotect ((caddr_t) (l->l_addr + c->mapend),
- loadcmds[nloadcmds - 1].mapstart - c->mapend,
- PROT_NONE);
+ {
+ /* Change protection on the excess portion to disallow all access;
+ the portions we do not remap later will be inaccessible as if
+ unallocated. Then jump into the normal segment-mapping loop to
+ handle the portion of the segment past the end of the file
+ mapping. */
+ if (__glibc_unlikely
+ (__mprotect ((caddr_t) (l->l_addr + c->mapend),
+ loadcmds[nloadcmds - 1].mapstart - c->mapend,
+ PROT_NONE) < 0))
+ return DL_MAP_SEGMENTS_ERROR_MPROTECT;
+ }
l->l_contiguous = 1;
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
elf/dl-map-segments.h | 20 ++++++++++++--------
2 files changed, 19 insertions(+), 8 deletions(-)
hooks/post-receive
--
GNU C Library master sources