-
Notifications
You must be signed in to change notification settings - Fork 804
[DeviceASAN] Enhance out-of-bound by checking shadow bounds on global memory #20079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: sycl
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Enhances the Device AddressSanitizer (DeviceASAN) to detect arbitrary out-of-bounds memory access on global memory by adding shadow memory boundary checks.
- Adds
GLOBAL
andGENERIC
memory types toMemoryType
enum for better memory classification - Implements shadow memory lower/upper bounds tracking to catch out-of-bounds accesses
- Reorders shadow memory update to occur before kernel launch preparation
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
sanitizer_libdevice.hpp | Refactors MemoryType enum to use bitfield values and adds GLOBAL/GENERIC memory types |
asan_shadow.hpp | Adds ShadowLowerBound and ShadowUpperBound tracking fields |
asan_shadow.cpp | Updates shadow bounds when mapping virtual memory pages |
asan_libdevice.hpp | Adds GlobalShadowLowerBound and GlobalShadowUpperBound to AsanRuntimeData |
asan_interceptor.cpp | Reorders shadow memory update and adds bounds to launch data logging |
arbitary_access.cpp | Adds test case for arbitrary out-of-bounds access detection |
asan_rtl.cpp | Implements shadow boundary checks in MemToShadow functions |
sycl/test-e2e/AddressSanitizer/out-of-bounds/USM/arbitary_access.cpp
Outdated
Show resolved
Hide resolved
lit test is also passed. llvm-lit --param sycl_devices=level_zero:gpu--param cxx_flags="-Xarch_device -mllvm=-asan-spir-shadow-bounds=1" -sv .
Total Discovered Tests: 58
Unsupported : 5 (8.62%)
Passed : 52 (89.66%)
Expectedly Failed: 1 (1.72%)
llvm-lit --param sycl_devices=opencl:cpu --param cxx_flags="-Xarch_device -mllvm=-asan-spir-shadow-bounds=1" -sv .
Total Discovered Tests: 58
Unsupported : 5 (8.62%)
Passed : 52 (89.66%)
Expectedly Failed: 1 (1.72%) |
@intel/dpcpp-sanitizers-review @intel/unified-runtime-reviewers please review, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp:188
- Semicolon should be removed after the closing brace. This appears to be a stray semicolon that makes the code syntactically incorrect.
}
Record the boundary of mapped shadow memory (VA), so that we can check if the accessed unknown address address is an out-of-bound access.
Usage:
Misc.
detect_locals
anddetect_privates
has been deprecated. Just using compiler flag to disable these checkings is enough