]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Inappropriate code style for Intel MPX in elf/dl-close.c
authorLiubov Dmitrieva <liubov.dmitrieva@intel.com>
Thu, 8 Nov 2012 12:35:39 +0000 (16:35 +0400)
committerLiubov Dmitrieva <ldmitrie@sourceware.org>
Wed, 23 Oct 2013 15:07:35 +0000 (19:07 +0400)
A cast implies memory access with bounds violation.
Let allow that.

elf/dl-close.c

index fe3014cca3f593cff9f230013d485ccadf577981..15775ecb583d5014caf49827d47b8eefe270c1fc 100644 (file)
@@ -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