4 ms·
"The need for memory safety standards" (2025-02) https://news.ycombinator.com/item?id=43189934 https://news.ycombinator.com/item?id=43189934 : > Technologies l
by westurner 11mo ago
"The need for memory safety standards" (2025-02) https://news.ycombinator.com/item?id=43189934 https://news.ycombinator.com/item?id=43189934 :
> Technologies like ARM's Memory Tagging Extension (MTE) and the Capability Hardware Enhanced RISC Instructions (CHERI) architecture offer a complementary defense, particularly for existing code.
From OP: https://www.preludesecurity.com/blog/windows-arm64-internals-deconstructing-pointer-authentication https://www.preludesecurity.com/blog/windows-arm64-internals... :
> In addition, current-generation ARM64 Microsoft devices, like the Surface Pro, are not shipped with chips that can support the Memory Tagging Extension (MTE) feature. Although not implemented today on Windows systems, the implementation of both PAC and MTE in the future would serve to greatly increase the cost of memory corruption exploits.
"The Arm64 memory tagging extension in Linux" (2020) on LWN:
https://news.ycombinator.com/item?id=24824378#24829160 https://news.ycombinator.com/item?id=24824378#24829160
ASan: AddressSanitizer
MSan: MemSan: MemorySanitizer
Google/sanitizers is archived because it was merged into LLVM sanitizers. https://github.com/google/sanitizers/ https://github.com/google/sanitizers/ :
> The Sanitizers project, which includes AddressSanitizer, MemorySanitizer, ThreadSanitizer, LeakSanitizer, and more, is now archived.
LLVM Clang docs > AddressSanitizer:
https://clang.llvm.org/docs/AddressSanitizer.html https://clang.llvm.org/docs/AddressSanitizer.html
There's a google/sanitizers wiki page from 2019 about Stack Instrumentation with ARM MTE Memory Tagging Extensions:
https://github.com/google/sanitizers/wiki/Stack-instrumentation-with-ARM-Memory-Tagging-Extension-(MTE)/5dc1d66c34d5fbf50daf3e27de590e1a62e85e56 https://github.com/google/sanitizers/wiki/Stack-instrumentat...
/? MemTagSanitizer https://www.google.com/search?q=MemTagSanitizer https://www.google.com/search?q=MemTagSanitizer
"Color My World: Deterministic Tagging for Memory Safety" (2022)
https://arxiv.org/abs/2204.03781 https://arxiv.org/abs/2204.03781 :
> 7.3 Pointer-safe tagging:
Recall that safe allocations could still allow inter-object cor-
ruption unless it is also pointer-safe (Sections 5.3 and 6.3).
To distinguish such safe, but pointer-unsafe allocations, we
tag them using the 0b10xx. Consequently, we can at run-time
distinguish pointers loaded from pointer-safe allocations, and
apply tag forgery prevention to all other loaded pointers.
LLVM Clang docs > MemSanitizer:
https://llvm.org/docs/MemTagSanitizer.html https://llvm.org/docs/MemTagSanitizer.html :
> Introduction: Note: this page describes a tool under development. Part of this functionality is planned but not implemented. Hardware capable of running MemTagSanitizer does not exist as of Oct 2019.
> MemTagSanitizer is a fast memory error detector and a code hardening tool based on the Armv8.5-A Memory Tagging Extension. It detects a similar class of errors as AddressSanitizer or HardwareAssistedAddressSanitizer, but with much lower overhead.
> MemTagSanitizer overhead is expected to be in low single digits, both CPU and memory. There are plans for a debug mode with slightly higher memory overhead and better diagnostics. The primary use case of MemTagSanitizer is code hardening in production binaries, where it is expected to be a strong mitigation for both stack and heap-based memory bugs.
-fsanitize=memtag
Code sanitizer:
https://en.wikipedia.org/wiki/Code_sanitizer https://en.wikipedia.org/wiki/Code_sanitizer
-fsanitize
- westurner 11mo agoDoes -fsanitize=memtag already work with RISC-V CHERI? https://github.com/CHERI-Alliance/llvm-project https://github.com/CHERI-Alliance/llvm-project : > Codasip LLVM compiler can be checked out from the codasip-cheri-riscv branch /? "codasip-cheri-riscv" llvm https://www.google.com/search?q=%22codasip-cheri-riscv%22+llvm https://www.google.com/search?q=%22codasip-cheri-riscv%22+ll... codasip-cheri-riscv fork of LLVM: https://github.com/CHERI-Alliance/llvm-project/tree/codasip-cheri-riscv https://github.com/CHERI-Alliance/llvm-project/tree/codasip-... What is the command to diff this against the commit of LLVM that it was forked from and against the LLVM main branch?
- westurner 11mo agoLinks to the source for ARM MTE support in the LLVM / LLDB -fsanitize=memtag sanitizer: lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp : https://github.com/llvm/llvm-project/blob/main/lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp https://github.com/llvm/llvm-project/blob/main/lldb/source/P... lldb/source/Target/MemoryTagMap.cpp: https://github.com/llvm/llvm-project/blob/main/lldb/source/Target/MemoryTagMap.cpp https://github.com/llvm/llvm-project/blob/main/lldb/source/T... , lldb/unittests/Target/MemoryTagMapTest.cpp: https://github.com/llvm/llvm-project/blob/main/lldb/unittests/Target/MemoryTagMapTest.cpp https://github.com/llvm/llvm-project/blob/main/lldb/unittest... lldb/test/API/linux/aarch64/mte_*: https://github.com/llvm/llvm-project/tree/main/lldb/test/API/linux/aarch64 https://github.com/llvm/llvm-project/tree/main/lldb/test/API... clang/test/Driver/aarch64-mte.c: https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/aarch64-mte.c https://github.com/llvm/llvm-project/blob/main/clang/test/Dr... clang/unittests/Driver/SanitizerArgsTest.cpp looks thin: https://github.com/llvm/llvm-project/blob/main/clang/unittests/Driver/SanitizerArgsTest.cpp https://github.com/llvm/llvm-project/blob/main/clang/unittes... SanitizerArgs.cpp: https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/SanitizerArgs.cpp https://github.com/llvm/llvm-project/blob/main/clang/lib/Dri... llvm/docs/MemTagSanitizer.rst: https://github.com/llvm/llvm-project/blob/main/llvm/docs/MemTagSanitizer.rst https://github.com/llvm/llvm-project/blob/main/llvm/docs/Mem... : -fsanitize=memtag -fsanitize-memtag-mode= -f[no-]sanitize-memory-track-origins[=level] -march=armv8+memtag