Earlier quoted context omitted.
And common javascript engines. Turns out a lot of interpreters hide bits away in what they precieve to be unused address bits. Its one of those lessons that everyone seems to be constantly relearning. Address spaces grow. One of my first "real" jobs, when this topic came up a very senior person said something to the effect. We continue to find ways to use up one of those bits roughly every year. Moving from 32-64 bit…
Value tagging may (and often does) use the lower bits to distinguish pointers from other values (integer, boolean, character, etc.) as objects are memory aligned. In those schemes the growth of the address space doesn't matter.
The Arm64 memory tagging extension in Linux
61–70 of 71 posts
Re: The Arm64 memory tagging extension in Linux
#62Earlier quoted context omitted.
Note this is for the virtual address space, not only for actual physical RAM. Having 256TB mmap’ed (to another kind of storage) does not seems totally out of reach.
True, but also note that a 52b mode (i.e. 12 bit tag) is also supported. I can't imagine anyone needing more than 4PB in the next 30 years, and the security gains now is (in my opinion) worth the potential refactoring in 30+ years that would be required.
Re: The Arm64 memory tagging extension in Linux
#63It's a shame we're using the top of pointers for other data... It's almost as if we didn't learn from the "3gb memory hole", the "gate a20 memory limit", and countless other times when using special address bits came back to bite system designers as RAM got bigger...
2^48 == 256TB. Anyone needs more than 256 Terabytes of RAM?
Intel added support for 5-level page tables (bumping virtual memory to 2^57 bytes) a few years ago: https://en.wikipedia.org/wiki/Intel_5-level_paging.
Re: The Arm64 memory tagging extension in Linux
#64Is this related to the CHERI stuff? https://vimeo.com/366246134 https://www.cl.cam.ac.uk/research/security/ctsrd/cheri/
It’s similar, but CHERI provides much stronger guarantees. (The ARM implementation will use 128-bit pointers, with the top half being used to store much more granular keys.)
MTE, OTOH, was specifically designed for detecting temporal bugs. For example, a freed object has the allocation tag (stored in memory) changed by the heap allocator so that the original pointer (with the original tag) can no longer access it. Of course, the trade-off is the 4 bits per 16-byte granule that need to be stored somewhere and the probabilistic nature (1 in 16 chance of hitting it).
But I think CHERI and MTE would complement each other nicely.
Re: The Arm64 memory tagging extension in Linux
#65isn't like, memory tagging explicitly forbidden in x86-64 ? iirc it was used in lisp compilers/interpreters to speed up object unboxing (as in answering the question: "what class does the object pointed by this pointer belong to?")
Correct. x86-64 mandates “canonical” addresses where all the upper bits must be the same in order to dereference a pointer.[0] So on a processor with 48 physical address lines, the upper 16 must be either all set or all unset. This is obviously to prevent people using those upper bits to store extra data. Of course, this doesn’t stop you from being able to[a], it just makes it harder. [a]: The processor doesn’t know…
Is it? It's something like two xors on a register. If that's a byte or two per pointer (ie: it's pointer metadata that you'd have to store anyway, which I assume is the use case) that's actually a pretty significant win, and could help reduce cache pressure, thereby buying you back the performance (and then some).
Addresses are also XOR'd all the time with a secret as a mitigation, I don't know that there's much of an impact at all.
Re: The Arm64 memory tagging extension in Linux
#66https://www.usenix.org/system/files/login/articles/login_sum...
Re: The Arm64 memory tagging extension in Linux
#674 bit keys seems a bit limiting... I could imagine lots of scenarios where a 1 in 16 chance of an exploit succeeding is still a big issue...
1. It still helps with defence in depth
2. The threat of detection prevents attackers that need 100% stealth
3. Failures are likely to be detected which is still valuable as you can now mitigate damage
4. Failures are likely to be detected which helps get software faults fixed - which allows the ecology of security to improve over time
Re: The Arm64 memory tagging extension in Linux
#68https://www.kernel.org/doc/html/latest/core-api/protection-k...
Re: The Arm64 memory tagging extension in Linux
#69Google plans to eventually make MTE a compulsory feature.
https://source.android.com/devices/tech/debug/tagged-pointer...
Re: The Arm64 memory tagging extension in Linux
#70Here is a Google engineer explaining how memory tagging extension works in more detail in a white paper. According to the paper, about 2/3 of all CVEs are memory safety bugs, and memory tagging will help with catching undiscovered ones. https://www.usenix.org/system/files/login/articles/login_sum...