Date: Wed, 26 Feb 2020 06:24:48 +0100 From: Markus Wichmann <nullplan@....net> To: musl@...ts.openwall.com Subject: [PATCH] Add REL_COPY size change detection Hi all, I was recently reading the Oracle docs about the ELF, and I came across their chapter about the COPY relocation. They discuraged its use, since with those relocations, a binding exists between importing and exporting module. If the semantics of the imported object changes, then this is an ABI mismatch. So I looked at the musl source code and noticed that COPY relocations are simply processed, and an ABI mismatch is simply accepted. So, since I am of the opinion that detectable errors should be detected, rather than left to fester and spring a hard-to-explain bug on you, usually five minutes before deadline, I wrote the attached patch to add detection for at least a changed size. This won't detect all changes to ABI regarding COPY relocation (e.g.int-->float, or in an array of structs, a change to the struct size and to the array size cancelling each other out), but it should find most of them. Also, I wondered whether COPY relocations are even still in use. But on my system (currently some Ubuntu version) I found over 15000 of the things. Mostly for stdout and stderr, though. Ciao, Markus View attachment "0001-Add-detection-for-changed-size-of-a-COPY-relocation.patch" of type "text/x-diff" (1591 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.