coreutils: Protect against env -a for security#10773
coreutils: Protect against env -a for security#10773oech3 wants to merge 1 commit intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
01b6655 to
753f86c
Compare
|
GNU testsuite comparison: |
Merging this PR will not alter performance
Comparing Footnotes
|
59e307c to
ac75ff7
Compare
|
GNU testsuite comparison: |
|
I think it would make sense for this code to go into the validation.rs file instead of in the main.rs, then you don't have to worry about importing libc. It would be good to have an additional integration test that shows the env -a working |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
1337cbc to
40581ee
Compare
|
GNU testsuite comparison: |
a5dd042 to
526f6fc
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
This comment was marked as outdated.
This comment was marked as outdated.
|
GNU testsuite comparison: |
This comment was marked as outdated.
This comment was marked as outdated.
b9cb65f to
5a57da3
Compare
|
GNU testsuite comparison: |
|
I was considering calling |
This comment was marked as outdated.
This comment was marked as outdated.
|
Is |
a2fec5c to
880c4ba
Compare
|
I did too many conversion for file pathes. Please drop them by review... |
|
GNU testsuite comparison: |
0c8b3c6 to
3b4ab62
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Co-authored-by: Etienne Cordonnier <ecordonnier@snap.com>
c54b52f to
2d60946
Compare
|
GNU testsuite comparison: |
|
is this ok? |
|
@Ecordonnier ok? |
| rust-ini = "0.21.0" | ||
| # binary name of coreutils can be hijacked by overriding getauxval via LD_PRELOAD | ||
| # So we use param and avoid libc backend | ||
| rustix = { version = "1.1.4", features = ["param"] } |
There was a problem hiding this comment.
same comment about rustix ?
why not libc or nix?
There was a problem hiding this comment.
In this case, nix or libc's getauxval can be hijacked by LD_PRELOAD. Directly scanning stack prevends it.
There was a problem hiding this comment.
seems overkill to add rustix for this for now
There was a problem hiding this comment.
Why? Multi-call binary is called many times. We should bypass overhead of linker if possible. Also this is already part of dependency tree.
There was a problem hiding this comment.
i would prefer we extract the code/method from rustix to do it here
There was a problem hiding this comment.
Extracting AT_EXECFN is low-level operation. We would achieve unsafe and magic constant.
env -a false lsdoes not fail. Works under masked/proc.Closes #10135