by kardos · 10y ago · 0 comments
Is it possible to reorder the symbols on the fly as the library is loaded?
In this case, what you would do is sort the symbols to produce a new binary, then run the binary with sorted symbols through sha256. So you're no longer asking if your binary is byte-for-byte equal to someone else's binary, you're asking if your binary is byte-for-byte equal if their symbols were sorted.
It complicates matters because you now have to do this custom reordering step before you hash (which means you can no longer do it easily with sha256sum or the type of program you might write in CS 101 that compares files byte-for-byte, you have to have trusted code which gets into the guts of the ELF format and reorder the symbols which increases the complexity and attack surface for reproducible binaries.)
If it's worth doing, surely the rest of the libraries would benefit as well. From a performance standpoint, it's pretty quick for libc, how slow will it be to do this for all libraries?
We have ASLR; is there a fundamental reason why ASLR can't be modified/extended/repurposed to achieve the same goal?
reproducible binaries doesn't really matter that much when you are compiling from source (you arn't proving that someone did or did not tamper with the binary provided, if no one is providing that binary in that situation)