Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linker string sharing causes corruption #46

Open
cleverca22 opened this issue May 10, 2023 · 1 comment
Open

linker string sharing causes corruption #46

cleverca22 opened this issue May 10, 2023 · 1 comment

Comments

@cleverca22
Copy link

more details in IntersectMBO/cardano-node#5223

https://i.imgur.com/xr5JQkW.png

ghc found a "00" in some unrelated code
and the "0000000000000000000000000000000000000000" in the dummySpace
and then it shared the last 3 bytes (the 00 and terminating null) between both strings

embedding a git rev within the binary, then changed the "00" in unrelated code

@cleverca22
Copy link
Author

https://github.com/openssl/openssl/blob/master/crypto/asn1/asn1_parse.c#L277
if (BIO_write(bp, "00", 2) <= 0)
after letting ghidra finish decompiling, i found that the "00" is shared between 4 places, some haskell code, and some openssl C code!

i suspect this is a linker bug, not a ghc bug

@cleverca22 cleverca22 changed the title ghc sharing causes corruption linker string sharing causes corruption May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant