summaryrefslogtreecommitdiff
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2019-04-03 17:50:30 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-04-03 17:50:30 +0000
commit06c65b864b3f7c2869f8d5b92cc53b1626c0b39a (patch)
tree4b54b7e336eafe7aa8c5911b57ef99020a44ba91 /libs/binder/ProcessState.cpp
parent7392a5c646b1288977e80202ebdc251d43ad1ad7 (diff)
parentbe5ee85e032bd6992e1acdfaca12ce9415c64d83 (diff)
Merge changes from topic "kernel_v503_2"
* changes: Update for kernel headers v5.0.3. getCallingSid: get calling security context
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 1c74e7b077..63f49ddba7 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -181,8 +181,20 @@ bool ProcessState::becomeContextManager(context_check_func checkFunc, void* user
mBinderContextCheckFunc = checkFunc;
mBinderContextUserData = userData;
- int dummy = 0;
- status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy);
+ flat_binder_object obj {
+ .flags = FLAT_BINDER_FLAG_TXN_SECURITY_CTX,
+ };
+
+ status_t result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR_EXT, &obj);
+
+ // fallback to original method
+ if (result != 0) {
+ android_errorWriteLog(0x534e4554, "121035042");
+
+ int dummy = 0;
+ result = ioctl(mDriverFD, BINDER_SET_CONTEXT_MGR, &dummy);
+ }
+
if (result == 0) {
mManagesContexts = true;
} else if (result == -1) {