[all-commits] [llvm/llvm-project] c97322: [compiler-rt][hwasan] Add fiber switch for HwASan ...

Tomahawkd via All-commits all-commits at lists.llvm.org
Tue Aug 19 17:49:05 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c97322d048e864701b687251397c73d64cb1af02
      https://github.com/llvm/llvm-project/commit/c97322d048e864701b687251397c73d64cb1af02
  Author: Tomahawkd <20868632+Tomahawkd at users.noreply.github.com>
  Date:   2025-08-19 (Tue, 19 Aug 2025)

  Changed paths:
    M compiler-rt/lib/hwasan/hwasan_interface_internal.h
    M compiler-rt/lib/hwasan/hwasan_thread.cpp
    M compiler-rt/lib/hwasan/hwasan_thread.h
    A compiler-rt/test/hwasan/TestCases/Linux/swapcontext_annotation.cpp

  Log Message:
  -----------
  [compiler-rt][hwasan] Add fiber switch for HwASan (#153822)

Currently HwASan has no fiber switch interface for coroutines. This PR
adds fiber switch interfaces similar to ASan which helps to pass sp
check correctly on unwinding.

The only difference is HwASan does not need a fake stack since tags can
do the same thing (e.g., detect UAR). Interfaces are made identical with
ASan's.

Also adds unit test which is similar to ASan with minor adjustments:

1. change `__asan_handle_no_return` to `__hwasan_handle_vfork`
2. remove huge stack test since `__hwasan_handle_vfork` has no stack
size limitation.
3. use uninstrumented globals to simulate allocation since hwasan do not
support tagged pointer while using `longjmp`

The testcase is tested on both x86 with alias mode enabled and aarch64.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list