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

support set rpath option for each target independently #111242

Merged
merged 2 commits into from
May 9, 2023

Conversation

wangkirin
Copy link
Contributor

Currently the rpath option is a global config and it's effect on all targets.
But sometimes when developers edit the rustc code and try to release rust toolchains themselves, they may not want to add rpath in all targets to avoid dynamically linked shared object library privilege escalation attack.
This PR supports set rpath option for each target independently .
Common developers are not aware of the existence of this configuration option and do not affect the existing development process. This configuration option takes effect only after developers explicitly sets .

r? @albertlarsan68

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 5, 2023
@albertlarsan68
Copy link
Member

Have you tested that this does the right thing (is overridden, the rpath is correct, the default does not change, etc...)?

@wangkirin
Copy link
Contributor Author

Hi @albertlarsan68

I've test several cases, the results are as follows

rpath option in [rust] section rpath option in Target 1 (x86_64-unknown-linux-gnu) rpath option in Target 2 (aarch64-unknown-linux-gnu) Result—RUNPATH in libstd.so of Target 1 Result—RUNPATH in libstd.so of Target 2 Test Result
Not Set Not Set Not Set YES YES PASS
Not Set true false YES NO PASS
Not Set false true NO YES PASS
true Not Set Not Set YES YES PASS
true true Not Set YES YES PASS
true false Not Set NO YES PASS
true false false NO NO PASS
true Not Set false YES NO PASS
false true true YES YES PASS
false true Not Set YES NO PASS
false Not Set true NO YES PASS
true Not Set invalid input(string) failed to parse TOML configuration 'config.toml': invalid type: string "foo", expected a boolean for key target.aarch64-unknown-linux-gnu.rpath
false invalid input(string) Not Set failed to parse TOML configuration 'config.toml': invalid type: string "foo", expected a boolean for key target.x86_64-unknown-linux-gnu.rpath
invalid input(string) true true failed to parse TOML configuration 'config.toml': invalid type: string "foo", expected a boolean for key rust.rpath
invalid input(string) false false failed to parse TOML configuration 'config.toml': invalid type: string "foo", expected a boolean for key rust.rpath

Copy link
Member

@albertlarsan68 albertlarsan68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Can you add an entry to bootstrap's changelog?

@wangkirin
Copy link
Contributor Author

wangkirin commented May 8, 2023

LGTM Can you add an entry to bootstrap's changelog?

@albertlarsan68 DONE,I've add an entry in Non-breaking changes

@albertlarsan68
Copy link
Member

Thanks for the PR!
@bors r+

@bors
Copy link
Contributor

bors commented May 9, 2023

📌 Commit bb4976a has been approved by albertlarsan68

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 9, 2023
…t_config, r=albertlarsan68

support set `rpath` option  for each target independently

Currently  the `rpath` option is a global config and it's effect on all targets.
But sometimes when developers edit the rustc code and try to release rust toolchains themselves, they may not want to add `rpath` in all targets  to avoid dynamically linked shared object library privilege escalation attack.
This PR supports set `rpath` option  for each target independently .
Common developers are not aware of the existence of this configuration  option and do not affect the existing development process. This configuration option takes effect only after developers explicitly sets .

r? `@albertlarsan68`
bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#97320 (Stabilize const_ptr_read)
 - rust-lang#110770 (Limit lifetime of format_args!() with inlined args.)
 - rust-lang#111021 (Move some tests)
 - rust-lang#111215 (Various changes to name resolution of anon consts)
 - rust-lang#111242 (support set `rpath` option  for each target independently)
 - rust-lang#111282 (Remove some `assume`s from slice iterators that don't do anything)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit efe697e into rust-lang:master May 9, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants