Loading libs/binder/Binder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ #include <binder/Parcel.h> #include <binder/RecordedTransaction.h> #include <binder/RpcServer.h> #include <private/android_filesystem_config.h> #include <pthread.h> #include <utils/misc.h> Loading @@ -45,6 +44,8 @@ namespace android { constexpr uid_t kUidRoot = 0; // Service implementations inherit from BBinder and IBinder, and this is frozen // in prebuilts. #ifdef __LP64__ Loading Loading @@ -300,7 +301,7 @@ status_t BBinder::startRecordingTransactions(const Parcel& data) { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid); return PERMISSION_DENIED; } Loading Loading @@ -330,7 +331,7 @@ status_t BBinder::stopRecordingTransactions() { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid); return PERMISSION_DENIED; } Loading Loading @@ -634,7 +635,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("%s: not allowed because client %" PRIu32 " is not root", __PRETTY_FUNCTION__, uid); return PERMISSION_DENIED; } Loading libs/binder/ndk/ibinder.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ #include <android/binder_status.h> #include <binder/IPCThreadState.h> #include <binder/IResultReceiver.h> #if __has_include(<private/android_filesystem_config.h>) #include <private/android_filesystem_config.h> #endif #include "ibinder_internal.h" #include "parcel_internal.h" Loading Loading @@ -229,7 +231,11 @@ status_t ABBinder::onTransact(transaction_code_t code, const Parcel& data, Parce // Shell commands should only be callable by ADB. uid_t uid = AIBinder_getCallingUid(); if (uid != AID_ROOT && uid != AID_SHELL) { if (uid != 0 /* root */ #ifdef AID_SHELL && uid != AID_SHELL #endif ) { if (resultReceiver != nullptr) { resultReceiver->send(-1); } Loading Loading
libs/binder/Binder.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -29,7 +29,6 @@ #include <binder/Parcel.h> #include <binder/RecordedTransaction.h> #include <binder/RpcServer.h> #include <private/android_filesystem_config.h> #include <pthread.h> #include <utils/misc.h> Loading @@ -45,6 +44,8 @@ namespace android { constexpr uid_t kUidRoot = 0; // Service implementations inherit from BBinder and IBinder, and this is frozen // in prebuilts. #ifdef __LP64__ Loading Loading @@ -300,7 +301,7 @@ status_t BBinder::startRecordingTransactions(const Parcel& data) { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid); return PERMISSION_DENIED; } Loading Loading @@ -330,7 +331,7 @@ status_t BBinder::stopRecordingTransactions() { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("Binder recording not allowed because client %" PRIu32 " is not root", uid); return PERMISSION_DENIED; } Loading Loading @@ -634,7 +635,7 @@ status_t BBinder::setRpcClientDebug(const Parcel& data) { return INVALID_OPERATION; } uid_t uid = IPCThreadState::self()->getCallingUid(); if (uid != AID_ROOT) { if (uid != kUidRoot) { ALOGE("%s: not allowed because client %" PRIu32 " is not root", __PRETTY_FUNCTION__, uid); return PERMISSION_DENIED; } Loading
libs/binder/ndk/ibinder.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,9 @@ #include <android/binder_status.h> #include <binder/IPCThreadState.h> #include <binder/IResultReceiver.h> #if __has_include(<private/android_filesystem_config.h>) #include <private/android_filesystem_config.h> #endif #include "ibinder_internal.h" #include "parcel_internal.h" Loading Loading @@ -229,7 +231,11 @@ status_t ABBinder::onTransact(transaction_code_t code, const Parcel& data, Parce // Shell commands should only be callable by ADB. uid_t uid = AIBinder_getCallingUid(); if (uid != AID_ROOT && uid != AID_SHELL) { if (uid != 0 /* root */ #ifdef AID_SHELL && uid != AID_SHELL #endif ) { if (resultReceiver != nullptr) { resultReceiver->send(-1); } Loading