On 2023-06-18 at 12:58:39 +0100, Polarian <polarian@polarian.dev> wrote:
I am far from an expert in linking but I thought that dynamic linking would be more secure because of address space randomisation, which I do not think can be replicated when all the libraries are statically linked into the executable and thus loaded into the same address space, correct me if I am wrong.
I'm also far from an expert in linking, but the very process of dyanmic lining can be subverted. I'm sure there are more, but two possibilities spring to mind immediately: (1) Dynamic linking depends on environment variables to find the dynamic libraries. Static applications are usually linked in a fairly clean environment, especially as compared to whatever happens to be there in a user environment. (2) With dynamic linking, one infected library is the same as multiple infected applications. Can you imagine what would happen if an intruder put their own version libc onto your system?