3 ms·
PACSafe: Leveraging ARM Pointer Authentication for Memory Safety in C/C++
- belter 5y ago"...we propose PACSafe, a memory safety approach based on ARM Pointer Authentication. PACSafe uses pointer signatures to retrofit full memory safety to C/C++ programs, protecting heap, stack, and globals against temporal and spatial vulnerabilities. We present a full, LLVM-based prototype implementation, running on an M1 MacBook Pro, i.e., on actual ARMv8.3 hardware. Our prototype evaluation shows that the system outperforms similar approaches under real-world conditions. This, together with its compatibility with uninstrumented libraries and cryptographic protection against attacks on metadata, makes PACSafe a viable solution for retrofitting memory safety to C/C++ programs." https://arxiv.org/pdf/2202.08669.pdf https://arxiv.org/pdf/2202.08669.pdf
- KerrAvon 5y agoBased on the performance results, this might be a viable approach for valgrind-type scenarios, but seems too slow/large for production code.
- olliej 5y agooof, that is quite the perf impact. I guess better than asan if you're on supported hardware?
- pcwalton 5y agoUnfortunately, it's an average 2x slowdown, and sometimes much higher. This is significantly slower than work from 15 years ago, such as CCured [1] (see section 8), which was still too high to achieve widespread adoption. CCured also had the advantage of not requiring special hardware. [1]: https://dl.acm.org/doi/pdf/10.1145/1065887.1065892 https://dl.acm.org/doi/pdf/10.1145/1065887.1065892
- Findecanor 5y agoThe scheme reminds me of ARM MTE - Memory Tagging Extension, but done in software with larger tags. In MTE, every pointer has a tag in its non-address bits that are checked against a tag for each object, stored in shadow memory. This scheme does not even use the Pointer Authentication on the pointer as such but as a generic cryptographic hash function to validate a 16-bit tag in the pointer against a 32-bit tag in memory. This means that PAC is not strictly necessary for the scheme. You'd only need to be able to calculate hashes of 32-bit values (+ key) down to 16 bits and stuff them into the higher unused bits of the pointer. The PAC instructions only do that a little bit faster than otherwise.
- ec109685 5y agoThe variability of slowdown is quite large. Seems like these techniques could be used at least around critical program sections that deal with user data. One of the key points from the paper was the fact that it could interoperate with non-protected code well.