[PATCH] D144136: Add a "remark" to report on array accesses

Kees Cook via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 10:55:25 PDT 2023


kees added a comment.

Can you refresh this patch to work with https://reviews.llvm.org/D148381 ? My testing seems to imply that it doesn't know the size of the array. I assume the `if (!IsUnboundedArray)` check is incomplete now. i.e. for a `__counted_by` array, I see the "unknown" remark:

  array-bounds.c:341:2: remark: accessing unknown sized array by 'index - 1' [-Rarray-bounds]
    341 |         TEST_ACCESS(p, array, index, SHOULD_TRAP);               
        |         ^                                 

which is from the `array-bounds.c` test cases:

  TEST_SIGNAL(counted_by_enforced_by_sanitizer, SIGILL)
  {
          struct annotated *p;
          int index = MAX_INDEX + unconst;
  
          p = alloc_annotated(index);
  
          REPORT_SIZE(p->array);
          TEST_ACCESS(p, array, index, SHOULD_TRAP);
  }




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144136/new/

https://reviews.llvm.org/D144136



More information about the cfe-commits mailing list