[compiler-rt] de916a7 - Revert "[hwasan] do not check if freed pointer belonged to allocator."

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 20:55:38 PDT 2021


would be great to include some details on why a patch is reverted in the
commit message - helps other folks know if the revert will fix an issue
they're seeing locally/on a buildbot, etc.

On Fri, Aug 20, 2021 at 4:21 AM Florian Mayer via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Florian Mayer
> Date: 2021-08-20T12:21:00+01:00
> New Revision: de916a7b12adc842a2cc23505d78412e8b5166d2
>
> URL:
> https://github.com/llvm/llvm-project/commit/de916a7b12adc842a2cc23505d78412e8b5166d2
> DIFF:
> https://github.com/llvm/llvm-project/commit/de916a7b12adc842a2cc23505d78412e8b5166d2.diff
>
> LOG: Revert "[hwasan] do not check if freed pointer belonged to allocator."
>
> This reverts commit 119146f8ae25c31ea630a15761a6fba6b7eb909c.
>
> Added:
>
>
> Modified:
>     compiler-rt/lib/hwasan/hwasan_allocator.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/compiler-rt/lib/hwasan/hwasan_allocator.cpp
> b/compiler-rt/lib/hwasan/hwasan_allocator.cpp
> index 3e7271f93fb61..63d86cf99e582 100644
> --- a/compiler-rt/lib/hwasan/hwasan_allocator.cpp
> +++ b/compiler-rt/lib/hwasan/hwasan_allocator.cpp
> @@ -208,7 +208,8 @@ static bool PointerAndMemoryTagsMatch(void
> *tagged_ptr) {
>  static bool CheckInvalidFree(StackTrace *stack, void *untagged_ptr,
>                               void *tagged_ptr) {
>    // This function can return true if halt_on_error is false.
> -  if (!PointerAndMemoryTagsMatch(tagged_ptr)) {
> +  if (!allocator.PointerIsMine(untagged_ptr) ||
> +      !PointerAndMemoryTagsMatch(tagged_ptr)) {
>      ReportInvalidFree(stack, reinterpret_cast<uptr>(tagged_ptr));
>      return true;
>    }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210830/a68ee1aa/attachment.html>


More information about the llvm-commits mailing list