Fixed(system-linker-exec): Exempt common alternative entrypoint process contexts from system linker exec - #39
Conversation
|
Will link to use case/bug reproduction walkthrough soon, forming webring |
824da62 to
4f04e2e
Compare
|
Note that documentation changes under |
4f04e2e to
b9e58f3
Compare
I'm not familiar with how to achieve that correctly, is there a guide for that in the context of this repository? Or do you mean that you will do that on your end? |
b9e58f3 to
366eef9
Compare
44d0446 to
71ab6d1
Compare
|
I have made some small changes, test them if you can before I merge. Normally merging locally can be done like this. I have already added the commit link to the docs, will have to update it if changes are made again. Replace git checkout -b pull-branch master
git pull https://github.com/termux/termux-exec-package.git pull-branch
git checkout master
git merge --ff-only pull-branch
git push origin master |
|
I have tested the current versions of both PRs with Magisk ( |
|
Ah, sorry. Will fix the commas in docs. Yeah, I can merge, but I have to currently go out, so will do it when I come back. Same termux-packages pull will work too due to dependency order. I meant if commits are pushed directly to master in wrong order and action builds. |
|
Thanks for testing. |
71ab6d1 to
212b475
Compare
|
Found an issue in |
Edit: that did not happen as assumed; some results from testing are posted below. |
|
Well, currently, the Google Play Termux vanilla version (unmodified from what Google Play Termux organization released, meaning it uses their
so at least as far as symptoms have been recorded at this point, the issue is specific to F-Droid Termux. I tried to find any patches specific to this, like a patch containing I have not yet attempted to install this repository github.com/termux/termux-exec-package into Google Play Termux to see what happens, or this PR, but after this somewhat unexpected result in Google Play Termux, I most likely will so that the results can be recorded. |
|
Google Play Termux's ADB shell entrypoints from |
|
Google Play Termux Table: Does
Test done to check for the enablement of system linker exec in the current shell: When the There's only one exception, which is with robertkirkman's PR with changes by agnostic-apollo. There, this message prints when the but when the same The error message itself seems to be working as expected, but at least during this test, it doesn't appear that what the |
|
I should probably write that even though I referred to you and me in the 3rd person in my last message, I don't use LLMs to do any writing of code or messages. I only wrote it that way intentionally because if I kept saying "your" and "my" in every other sentence, I think that would make the test results a lot harder to read. |
212b475 to
6bdf188
Compare
|
The termux org termux-exec has 2 library variants (
Both libraries support system linker exec and auto enables it if required based on android sdk/process context or if Additionally there are plans to add 2 more library variants The playstore termux-exec already has readlink/realpath hooks to replace paths passed to them with path in
The playstore termux-exec always enables system linker exec as long as executable starts with
Now back to what I originally meant in #39 (comment). The But now in this pull, you have added Hopefully that clears things up, let me know if I haven't answered something in your comments or if you have any new question. I still haven't tested myself cause of time issues, thanks for testing that my error in I have also replaced readlink with |
Yes, it appears as though maybe you did not quite get to yet, or address the results I recorded where this did not happen:
For me, this did not happen. Some more details of what did happen for me are posted above. Maybe I have set up the test in a strange way that caused a side effect somewhere, and your test later can reveal what went wrong. |
…abled()` to `shouldEnableSystemLinkerExec()` in `TermuxExecLDPreload` and move `is-enabled` command to `should-enable` in `termux-exec-system-linker-exec` and add a new implementation for `is-enabled` Also fixes reading of `TERMUX_EXEC__SYSTEM_LINKER_EXEC__MODE` variable without scoped `TERMUX_ENV__S_TERMUX_EXEC` prefix.
…ss contexts from system linker exec Co-authored-by: @robertkirkman <rkirkman@termux.dev> Co-authored-by: @agnostic-apollo <agnosticapollo@gmail.com> Related pull termux/termux-core-package#2 Closes termux#40
…nt process contexts from system linker exec Related commit termux@89422f43
…for commands like `termux-exec-system-linker-exec` which print the result to stdout and any non-command-output should be logged to stderr The termux-app bootstrap second stage "client" has already been fixed to not abort if stderr is set. - termux/termux-app@97f2537c
…EC__SYSTEM_LINKER_EXEC__MODE` env variable which does not check effective user id and add check in `force` mode to not use system linker exec if effective user id equals root (`0`) and shell (`2000`) user, as exec restrictions do not apply for them and would result in performance hit unnecessarily
…__SYSTEM_LINKER_EXEC__MODE` env variable Related commit termux@f7450d01
…configure` action, like `abort-upgrade`
6bdf188 to
4c72fe4
Compare
|
Thanks for the catch. Yes, direct variant always being set was not correct behaviour. It got broke in 8793fc7 as I had forgotten that Following are the tests done and everything is working as expected now. I have add I have found a new issue. If Termux uid owned shell is started with SeLinux logs the following error after disabling The issue does not occur if Additionally, To fix these, |
|
Thank you for explaining, and before now I did not know about that problem. I only tested creating and editing normal files from both entrypoints, not symbolic links, and it seems that normal files are not affected by that problem, only symbolic links, so I never knew that problem existed. Currently, I have noticed that the command I'm trying to figure out if there is any way to write code that can detect either whether SELinux is Enforcing, or whether the symbolic link problem itself is reproducible, while the active process context is the one where the error message needs to be shown by Some custom ROMs do not support SELinux Enforcing, so there are at least some cases where I believe the users are used to SELinux Permissive and would feel restricted if something blocks them in a way that should only block SELinux Enforcing devices. |
it's an interesting way to set it up, but one of the reasons I avoided that in my own tests is because that results in there being a |
|
I have found this way https://stackoverflow.com/questions/72868065/how-to-check-if-selinux-is-enforcing-or-permissive , like this: #include <stdio.h>
#include <selinux/selinux.h>
int main(void) {
printf("Is SELinux Enforcing: %s\n", is_selinux_enabled() && security_getenforce()
? "yes" : "no");
return 0;
}It works to detect whether SELinux is Enforcing without root, unlike the regular If you aren't already working on the check and error message for |




PROCESS_CONTEXT_PREFIX__RUNAS_APPandPROCESS_CONTEXT__KERNEL_SUtermux-core-package#2