Skip to content

[SWDEV-563823][Compiler-rt][ASan] Simplify API Logic 'asan_hsa_amd_…#890

Closed
ampandey-AMD wants to merge 1 commit intoROCm:amd-mainlinefrom
ampandey-AMD:cp-d82664fd15a57297e8bdfe45ebdb40b7c776a9d8
Closed

[SWDEV-563823][Compiler-rt][ASan] Simplify API Logic 'asan_hsa_amd_…#890
ampandey-AMD wants to merge 1 commit intoROCm:amd-mainlinefrom
ampandey-AMD:cp-d82664fd15a57297e8bdfe45ebdb40b7c776a9d8

Conversation

@ampandey-AMD
Copy link

…ipc_memory_create'. (#475)

  • Use reinterpret_cast for pointer arithmetic.
  • Add sanitizer interception logic for api 'hsa_amd_pointer_info'.
  • Allow only valid values of ptr and len in non-ASan mode.
    • ptr == Actual agentBaseAddress && len == original_len_used_in_alloc
  • Allow only valid values of ptr and len in ASan mode.
    • Here pinfo is retrieved from external hsa_amd_pointer_info(not internal device allocator function AmdgpuMemFuncs::GetPointerInfo) - ptr == pinfo.agentBaseAddress && len == pinfo.sizeInBytes
    • ptr == original_ptr_returned_by_ASAN && len == original_len_used_in_alloc

…pc_memory_create'. (ROCm#475)

- Use reinterpret_cast<uptr> for pointer arithmetic.
 - Add sanitizer interception logic for api 'hsa_amd_pointer_info'.
 - Allow only valid values of ptr and len in non-ASan mode.
    - ptr == Actual agentBaseAddress && len ==
      original_len_used_in_alloc
 - Allow only valid values of ptr and len in ASan mode.
    - Here pinfo is retrieved from external hsa_amd_pointer_info(not
      internal device allocator function AmdgpuMemFuncs::GetPointerInfo)
      - ptr == pinfo.agentBaseAddress && len == pinfo.sizeInBytes
    - ptr == original_ptr_returned_by_ASAN && len ==
      original_len_used_in_alloc
@ampandey-AMD ampandey-AMD deleted the cp-d82664fd15a57297e8bdfe45ebdb40b7c776a9d8 branch December 19, 2025 09:18
@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant