Merge header codeblock from <sanitizer/asan_interface.h>

This commit is contained in:
doyle 2023-08-28 23:41:57 +10:00
parent 8619b1a7e5
commit dd4de96742
2 changed files with 6 additions and 14 deletions

View File

@ -85,25 +85,21 @@ int main()
"\n" "\n"
"ASAN provides a way to manually markup ranges of bytes to\n" "ASAN provides a way to manually markup ranges of bytes to\n"
"prohibit or permit reads to those addresses. In\n" "prohibit or permit reads to those addresses. In\n"
"`<sanitizer/asan_interface.h>` there's a brief mention for the poison\n" "`<sanitizer/asan_interface.h>` there's a vague brief mention to\n"
"and unpoison API respectively:\n" "alignment requirements for the poison API:\n"
"\n" "\n"
"```cpp\n" "```cpp\n"
"/// ... This function is not guaranteed to poison the entire region -\n" "/// ... This function is not guaranteed to poison the entire region -\n"
"/// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan\n" "/// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan\n"
"/// alignment restrictions.\n" "/// alignment restrictions.\n"
"void __asan_poison_memory_region(void const volatile *addr, size_t size);\n" "void __asan_poison_memory_region(void const volatile *addr, size_t size);\n"
"```\n"
"\n" "\n"
"and:\n"
"\n"
"```cpp\n"
"/// ... This function could unpoison a super-region of <c>[addr, addr+size)</c> due\n" "/// ... This function could unpoison a super-region of <c>[addr, addr+size)</c> due\n"
"/// to ASan alignment restrictions.\n" "/// to ASan alignment restrictions.\n"
"void __asan_unpoison_memory_region(void const volatile *addr, size_t size);\n" "void __asan_unpoison_memory_region(void const volatile *addr, size_t size);\n"
"```\n" "```\n"
"\n" "\n"
"There's another brief foot-note in Google's " "There's another small foot-note in Google's "
"[AddressSanitizerManualPoisoning](https://github.com/google/" "[AddressSanitizerManualPoisoning](https://github.com/google/"
"sanitizers/wiki/AddressSanitizerManualPoisoning)\n" "sanitizers/wiki/AddressSanitizerManualPoisoning)\n"
"documentation that states:\n" "documentation that states:\n"

View File

@ -26,25 +26,21 @@ marked-up memory that may lead to undetected read/writes.
ASAN provides a way to manually markup ranges of bytes to ASAN provides a way to manually markup ranges of bytes to
prohibit or permit reads to those addresses. In prohibit or permit reads to those addresses. In
`<sanitizer/asan_interface.h>` there's a brief mention for the poison `<sanitizer/asan_interface.h>` there's a vague brief mention to
and unpoison API respectively: alignment requirements for the poison API:
```cpp ```cpp
/// ... This function is not guaranteed to poison the entire region - /// ... This function is not guaranteed to poison the entire region -
/// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan /// it could poison only a subregion of <c>[addr, addr+size)</c> due to ASan
/// alignment restrictions. /// alignment restrictions.
void __asan_poison_memory_region(void const volatile *addr, size_t size); void __asan_poison_memory_region(void const volatile *addr, size_t size);
```
and:
```cpp
/// ... This function could unpoison a super-region of <c>[addr, addr+size)</c> due /// ... This function could unpoison a super-region of <c>[addr, addr+size)</c> due
/// to ASan alignment restrictions. /// to ASan alignment restrictions.
void __asan_unpoison_memory_region(void const volatile *addr, size_t size); void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
``` ```
There's another brief foot-note in Google's [AddressSanitizerManualPoisoning](https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning) There's another small foot-note in Google's [AddressSanitizerManualPoisoning](https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning)
documentation that states: documentation that states:
``` ```