Skip to content

Commit

Permalink
Eliminate ASan stack-buffer-underflow FP in GC_mark_and_push_stack (E2K)
Browse files Browse the repository at this point in the history
According to the contract, the object p (the argument of
GC_mark_and_push_stack) has passed a preliminary pointer validity
check, but we do not definitely know whether it is valid.

* mark.c (GC_mark_and_push_stack): Add GC_ATTR_NO_SANITIZE_ADDR
attribute.
  • Loading branch information
ivmai committed Jul 15, 2022
1 parent 6383392 commit 4919305
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -1466,10 +1466,12 @@ GC_API struct GC_ms_entry * GC_CALL GC_mark_and_push(void *obj,
/* test, but we do not definitely know whether it is valid. */
/* Mark bits are NOT atomically updated. Thus this must be the */
/* only thread setting them. */
GC_ATTR_NO_SANITIZE_ADDR
GC_INNER void
# if defined(PRINT_BLACK_LIST) || defined(KEEP_BACK_PTRS)
GC_INNER void GC_mark_and_push_stack(ptr_t p, ptr_t source)
GC_mark_and_push_stack(ptr_t p, ptr_t source)
# else
GC_INNER void GC_mark_and_push_stack(ptr_t p)
GC_mark_and_push_stack(ptr_t p)
# define source ((ptr_t)0)
# endif
{
Expand Down

0 comments on commit 4919305

Please sign in to comment.