Skip to content

Do not let modifyRPath taint shared strings in strtab. Fix #315#481

Merged
bors[bot] merged 4 commits intoNixOS:masterfrom
brenoguim:breno.315
Apr 23, 2023
Merged

Do not let modifyRPath taint shared strings in strtab. Fix #315#481
bors[bot] merged 4 commits intoNixOS:masterfrom
brenoguim:breno.315

Conversation

@brenoguim
Copy link
Copy Markdown
Collaborator

@brenoguim brenoguim commented Mar 17, 2023

In this PR I add a method to iterate over all fields of the ELF file (as best as we can) that represent indexes in strtable.

I use this method to check if the RPATH string being changed in modifyRPATH is shared among multiple fields. If it's shared, don't let patchelf taint the field.

We hope that patchelf continues to taint the vast majority of rpaths (as needed by Nix) but only refrain from doing so when it will break the binary.

Note: The first commit changes the section tainting from X to Z so I can look for the Xs in my tests.

@brenoguim brenoguim changed the title Do not let modifyRPath taint shared strings in strtab Do not let modifyRPath taint shared strings in strtab. Fix #315 Mar 17, 2023
@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Apr 23, 2023

bors merge

@bors bors bot merged commit 6e7b82e into NixOS:master Apr 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

Successfully merging this pull request may close these issues.

2 participants