Skip to content

Commit 7f2b123

Browse files
authored
[ASan] Document that manually posioned memory must be eventually manually unpoisoned
1 parent fc8d9d5 commit 7f2b123

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/sanitizers/asan-runtime.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ For convenience, the [AddressSanitizer interface header file](https://github.com
9090
#define ASAN_UNPOISON_MEMORY_REGION(addr, size)
9191
```
9292

93+
> [!NOTE]
94+
> Manually poisoned memory must be eventually unpoisoned by the end-user. Otherwise, ASan may report false positives.
95+
9396
## Alignment requirements for AddressSanitizer poisoning
9497

9598
Any manual poisoning of shadow bytes must consider the alignment requirements. The user must add padding if necessary so the shadow bytes end on a byte boundary in the shadow memory. Each bit in the AddressSanitizer shadow memory encodes the state of a single byte in the application's memory. This encoding means the total size of each allocation, including any padding, must align to an 8-byte boundary. If the alignment requirement isn't satisfied, it can lead to incorrect bug reporting. The incorrect reporting could manifest as missing reports (false negatives) or reports on non-errors (false-positives).

0 commit comments

Comments
 (0)