Skip to content

coreutils: restrict utility_from_symlink to non-symlink target - #16895

Closed
oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:util-from-symlink
Closed

oech3 wants to merge 1 commit into
uutils:mainfrom
oech3:util-from-symlink

Conversation

@oech3

@oech3 oech3 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #16893
This is also preliminary for #16848 and #15785 .

We don't do anything special for PATH. Then test cases can be simplified.

@oech3
oech3 force-pushed the util-from-symlink branch from df7ffa7 to f423a4e Compare November 27, 2026 07:34
@oech3

oech3 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Not safe-traversal? It might needed to believe root-owned (/usr/bin/*) target only...

@oech3

oech3 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

readlink(AT_EXECFN) has no abusable race:
If AT_EXECFN=../dummy, but replaced with different symlink before readlink(2), we run changed target with its AppArmor profile.

Comment thread src/bin/coreutils.rs Resolved
Comment thread tests/test_util_name.rs Resolved
Comment thread tests/test_util_name.rs Resolved
@oech3
oech3 force-pushed the util-from-symlink branch 2 times, most recently from 1c6cec9 to b6ff7e7 Compare November 27, 2026 14:45
@oech3

oech3 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

It seems safe-traversal 2nd readlink is complex. Is it OK to restrict this to dummy -> root-owned binary?

@oech3 oech3 closed this Nov 27, 2026
@oech3
oech3 deleted the util-from-symlink branch November 27, 2026 15:42
@oech3
oech3 restored the util-from-symlink branch November 27, 2026 15:45
@oech3
oech3 deleted the util-from-symlink branch November 27, 2026 16:09
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.

coreutils: restrict utility_from_symlink's target to /usr/bin/* (BINDIR of GNUmakefile)

2 participants