It'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...
The Arm64 memory tagging extension in Linux
11–20 of 71 posts
Re: The Arm64 memory tagging extension in Linux
#12So a key is stored in the unused portion of memory pointers which should match the key associated to the memory it points to. I couldn’t figure out from the article where the key is stored in the corresponding memory. Can anyone explain?
Re: The Arm64 memory tagging extension in Linux
#13How does this impact software that does memory pointer comparisons? Eg. Store pointers to all these objects into a std::set? The memory tag will now form part of the keys to this set, and would affect iteration order etc... It could cause breakage in existing applications.
Re: The Arm64 memory tagging extension in Linux
#14Earlier quoted context omitted.
The keys are stored in the bottom nibble of the top byte of pointers (I.e. bits 56-59)
Yes, but they also need to be stored somewhere else for the CPU to compare them against something... Where else are they stored...
Re: The Arm64 memory tagging extension in Linux
#154 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...
It's faster then doing the same in code (e.g. via 'tagged handles': https://floooh.github.io/2018/06/17/handles-vs-pointers.html), or memory debugging tools like Valgrind or clang ASAN (and unlike Valgrind or ASAN, the checks are always enabled, also in the "release version").
Re: The Arm64 memory tagging extension in Linux
#16It'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...
Anyone needs more than 256 Terabytes of RAM?
Re: The Arm64 memory tagging extension in Linux
#17It'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...
EDIT: My math is bad, see comments below.
I can unsarcastically say that no one will ever need full 64bit addresses on this planet.
Re: The Arm64 memory tagging extension in Linux
#18How does this impact software that does memory pointer comparisons? Eg. Store pointers to all these objects into a std::set? The memory tag will now form part of the keys to this set, and would affect iteration order etc... It could cause breakage in existing applications.
Memory allocators are already returning more or less "random" pointers, so using pointers for sorting is already a bad idea. Even using pointers for equality-comparison isn't usually a good idea because the same memory location might be reused when the allocator recycles memory (those tags could actually help with making such "recycled" pointers unique over time).
There are also cases of custom suballocators or arrays of objects - Looking at an address makes it possibly to figure out which array it belongs to. This code would break.
Granted, it would still be possible to do all this if you just mask off the tag bits, but it requires a software change.
Re: The Arm64 memory tagging extension in Linux
#19It'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...
The estimated number of atoms on earth is on the order of 1e50, which is 60 bits. If you take the 4 bits out of the 64bit address for tagging, you can still address individual atoms. EDIT: My math is bad, see comments below. I can unsarcastically say that no one will ever need full 64bit addresses on this planet.
2^71 bits - total hard drive capacity shipped in 2016 [0]
I doubt your calculations.
[0] https://en.wikipedia.org/wiki/Orders_of_magnitude_(data)
Re: The Arm64 memory tagging extension in Linux
#20So a key is stored in the unused portion of memory pointers which should match the key associated to the memory it points to. I couldn’t figure out from the article where the key is stored in the corresponding memory. Can anyone explain?