From 5dad50d8242a59291294a71c0d48aec966880c32 Mon Sep 17 00:00:00 2001 From: Liubov Dmitrieva Date: Thu, 8 Nov 2012 16:35:39 +0400 Subject: [PATCH] Inappropriate code style for Intel MPX in elf/dl-close.c A cast implies memory access with bounds violation. Let allow that. --- elf/dl-close.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.47.2