Closed ltomb closed 1 year ago
avc: denied { search } for name="com.termux" dev="sda17" ino=4710699 scontext=u:r:untrusted_app_27:s0:c88,c258,c512,c768 tcontext=u:object_r:app_data_file:s0:c81,c258,c512,c768 tclass=dir permissive=0 app=com.termux
drwx------ 3 u0_a600 u0_a600 u:object_r:app_data_file:s0:c81,c258,c512,c768 4.0K 2023-01-03 09:49 /data/data/com.termux
Issue is that your /data/data/com.termux
directory is owned by uid 10600
, the same as termux app process security context c88,c258
but security context assigned to the directory is c81,c258
, which is for uid
10593
, resulting in selinux denials.
If you are rooted, there may have been root
owned files under /data/data/com.termux
that prevented deletion of the directory during last uninstallation.
If you are rooted, then run su -c "rm -rf '/data/data/com.termux'"
from a failsafe session, then uninstall termux app and install termux app again.
https://wiki.termux.com/wiki/Recover_a_broken_environment
If you are not rooted, then try uninstalling termux app, then rebooting and installing it again. If same issue, then factory reset would likely be required since won't be able to delete directory or restore its context with restorecon
without root AFAIK, the adb
shell
user doesn't have such privileges either.
I checked the connection to http://termux.net/bootstrap/ and i get PAGE_NOT_FOUND.
That is from very old version. Termux does not download bootstrap anymore and is irrelevant.
Closing since not an issue with termux app itself.
The c[0-9]+,c[0-9]+,c[0-9]+,c[0-9]+
categories are part of Multi-Category Security (MCS)
and required to Isolate the app data from access by another app
and Isolate the app data from one physical user to another
. Both the process and file security context have categories assigned and the process categories must be a superset or equal the file categories to be allowed access. For example for c160,c256,c512,c768
:
c160
is for appid
for uid
10160
and it would get changed to c161
for uid
10161
. The second category c256
would get incremented to c257
when appid
crosses 255
and first category would get reset to c0
and same will happen when appid
crosses 511
.c512
is for userid
0
(primary user) and it would get changed to c522
for userid
10
(secondary user). The forth category c768
would get incremented to c769
when userid
crosses 255
and third category would get reset to c0
and same will happen when userid
crosses 511
.c160,c256,c512,c768
will be able to access files with categories c160,c256,c512,c768
or files with no categories but not with categories c161,c256,c512,c768
(different appid
) or c160,c256,c522,c768
(different userid
).uid
for normal apps with AID_APP_START >= uid < AID_SDK_SANDBOX_PROCESS_START
is converted to appid
with ((uid % AID_USER_OFFSET) - AID_APP_START)
.uid
is assigned to apps with (userid * AID_USER_OFFSET + AID_APP_START + appid)
.AID_USER_OFFSET 100000 /* offset for uid ranges for each user */
AID_APP_START 10000 /* first app user */
AID_APP_END 19999 /* last app user */
profile user 0: (0 * 100000 + 10000 + 160) -> 10160/u0_a160
profile user 10: (10 * 100000 + 10000 + 160) -> 1010160/u10_a160
profile user 256: (256 * 100000 + 10000 + 160) -> 25610160/u256_a160
public static String getCategories(int uid) {
int userid = (uid / 100000 /* AID_USER_OFFSET */);
int appid = ((uid % 100000 /* AID_USER_OFFSET */) - 10000 /* AID_APP_START */);
return "c" + (appid & 0xff) +
",c" + (256 + (appid>>8 & 0xff)) +
",c" + (512 + (userid & 0xff)) +
",c" + (768 + (userid>>8 & 0xff));
}
# (uid, userid) = (categories)
(10000,0) = (c0,c256,c512,c768)
(10088,0) = (c88,c256,c512,c768)
(10099,0) = (c99,c256,c512,c768)
(10100,0) = (c100,c256,c512,c768)
(10160,0) = (c160,c256,c512,c768)
(10212,0) = (c212,c256,c512,c768)
(10255,0) = (c255,c256,c512,c768)
(10256,0) = (c0,c257,c512,c768)
(10511,0) = (c255,c257,c512,c768)
(10512,0) = (c0,c258,c512,c768)
(10593,0) = (c81,c258,c512,c768)
(10600,0) = (c88,c258,c512,c768)
(10999,0) = (c231,c259,c512,c768)
(11000,0) = (c232,c259,c512,c768)
(1010000,10) = (c0,c256,c522,c768)
(1010088,10) = (c88,c256,c522,c768)
(1010099,10) = (c99,c256,c522,c768)
(1010100,10) = (c100,c256,c522,c768)
(1010160,10) = (c160,c256,c522,c768)
(1010212,10) = (c212,c256,c522,c768)
(1010255,10) = (c255,c256,c522,c768)
(1010256,10) = (c0,c257,c522,c768)
(1010511,10) = (c255,c257,c522,c768)
(1010512,10) = (c0,c258,c522,c768)
(1010593,10) = (c81,c258,c522,c768)
(1010600,10) = (c88,c258,c522,c768)
(1010999,10) = (c231,c259,c522,c768)
(1011000,10) = (c232,c259,c522,c768)
(25610160,256) = (c160,c256,c512,c769)
(25610255,256) = (c255,c256,c512,c769)
(25610256,256) = (c0,c257,c512,c769)
(25610511,256) = (c255,c257,c512,c769)
(25610512,256) = (c0,c258,c512,c769)
(25610600,256) = (c88,c258,c512,c769)
Thanks for your reply,
- Did you install termux previously and uninstalled it?
- Are you rooted?
- Did you restore termux app data with a backup app?
If you are rooted, there may have been
root
owned files under/data/data/com.termux
that prevented deletion of the directory during last uninstallation.
Under /data/data/
I have no com.termux
folder
If you are rooted, then uninstall termux app, then run
su -c "rm -rf '/data/data/com.termux'"
from a failsafe session and install termux app again.
How should I run a Failsafe session with no termux app installed?
I managed to solve by manually deleting the com.termux
folder in /data_mirror/data_ce/null/0
and then reinstalling.
Since in Android 11 data/data folder is no longer accessible for privacy reason, i couldn't access the directory from solid explorer. And i also could not run any command from termux
https://forum.xda-developers.com/t/android-11-how-to-access-and-modify-all-files-in-root-data-data.4373729/ https://www.ghisler.ch/board/viewtopic.php?t=75934
Welcome. Cool.
Problem description
Unable to install termux on oneplus 6t, on android 11. Termux was downloaded from Github. Looking in previous issues, I checked the connection to http://termux.net/bootstrap/ and i get PAGE_NOT_FOUND.
Anyway here's the log
Report Info
User Action:
crash report
Sender:
TermuxInstaller
Report Timestamp:
2023-01-03 08:56:24.843 UTC
Bootstrap Error
(150) FileUtils Error: The termux files directory not found at path "/data/data/com.termux/files". TERMUX_FILES_DIR:
/data/data/com.termux/files
Termux Files Info
TERMUX_REQUIRED_FILES_DIR_PATH ($PREFIX):
/data/data/com.termux/files
ANDROID_ASSIGNED_FILES_DIR_PATH:
/data/user/0/com.termux/files
Logcat Dump
Termux App Info
APP_NAME:
Termux
PACKAGE_NAME:
com.termux
VERSION_NAME:
0.118.0
VERSION_CODE:
118
TARGET_SDK:
28
IS_DEBUGGABLE_BUILD:
true
TERMUX_FILES_DIR:
/data/data/com.termux/files
IS_TERMUX_FILES_DIR_ACCESSIBLE:
false - (150) FileUtils Error: The termux files directory not found at path "/data/data/com.termux/files".
APK_RELEASE:
Github
SIGNING_CERTIFICATE_SHA256_DIGEST:
B6DA01480EEFD5FBF2CD3771B8D1021EC791304BDD6C4BF41D3FAABAD48EE5E1
Device Info
Software
OS_VERSION:
4.9.227-perf+
SDK_INT:
30
RELEASE:
11
ID:
RKQ1.201217.002
DISPLAY:
ONEPLUS A6013_41_211125
INCREMENTAL:
2111252327
SECURITY_PATCH:
2021-07-01
IS_DEBUGGABLE:
0
IS_TREBLE_ENABLED:
true
TYPE:
user
TAGS:
release-keys
Hardware
MANUFACTURER:
OnePlus
BRAND:
OnePlus
MODEL:
ONEPLUS A6013
PRODUCT:
OnePlus6T
BOARD:
sdm845
HARDWARE:
qcom
DEVICE:
OnePlus6T
SUPPORTED_ABIS:
arm64-v8a, armeabi-v7a, armeabi
Steps to reproduce the behavior.
Installing from github APK, release 0.118
What is the expected behavior?
No response
System information