From: Liubov Dmitrieva Date: Thu, 8 Nov 2012 12:35:39 +0000 (+0400) Subject: Inappropriate code style for Intel MPX in elf/dl-close.c X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5dad50d8242a59291294a71c0d48aec966880c32;p=thirdparty%2Fglibc.git Inappropriate code style for Intel MPX in elf/dl-close.c A cast implies memory access with bounds violation. Let allow that. --- diff --git a/elf/dl-close.c b/elf/dl-close.c index fe3014cca3f..15775ecb583 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -347,6 +347,10 @@ _dl_close_worker (struct link_map *map) struct link_map *tmap = (struct link_map *) ((char *) imap->l_scope[cnt] - offsetof (struct link_map, l_searchlist)); +#ifdef __CHKP__ + tmap = __bnd_set_ptr_bounds(tmap, sizeof(struct link_map)); +#endif + assert (tmap->l_ns == nsid); if (tmap->l_idx == IDX_STILL_USED) ++remain; @@ -393,6 +397,9 @@ _dl_close_worker (struct link_map *map) struct link_map *tmap = (struct link_map *) ((char *) imap->l_scope[cnt] - offsetof (struct link_map, l_searchlist)); +#ifdef __CHKP__ + tmap = __bnd_set_ptr_bounds(tmap, sizeof(struct link_map)); +#endif if (tmap->l_idx != IDX_STILL_USED) { /* Remove the scope. Or replace with own map's