blob: d581736f3e27a17643659a0b95d37fe37ac2da00 [file] [log] [blame]
Andres Morales2d08dce2015-04-03 16:40:15 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "gatekeeperd"
18
19#include "IGateKeeperService.h"
20
Andres Morales6a49c2f2015-04-16 13:16:24 -070021#include <errno.h>
Andres Morales6a49c2f2015-04-16 13:16:24 -070022#include <fcntl.h>
Mark Salyzyn66ce3e02016-09-28 10:07:20 -070023#include <inttypes.h>
24#include <stdint.h>
Andres Morales6a49c2f2015-04-16 13:16:24 -070025#include <unistd.h>
Justin Yun919cc552017-08-16 18:54:20 +090026#include <memory>
Andres Morales6a49c2f2015-04-16 13:16:24 -070027
Andres Morales2d08dce2015-04-03 16:40:15 -070028#include <binder/IPCThreadState.h>
29#include <binder/IServiceManager.h>
30#include <binder/PermissionCache.h>
Andres Morales6a49c2f2015-04-16 13:16:24 -070031#include <gatekeeper/password_handle.h> // for password_handle_t
Andres Morales2d08dce2015-04-03 16:40:15 -070032#include <hardware/gatekeeper.h>
Andres Morales6a49c2f2015-04-16 13:16:24 -070033#include <hardware/hw_auth_token.h>
Mark Salyzyn66ce3e02016-09-28 10:07:20 -070034#include <keystore/IKeystoreService.h>
35#include <keystore/keystore.h> // For error code
Mark Salyzyn30f991f2017-01-10 13:19:54 -080036#include <log/log.h>
Mark Salyzyn66ce3e02016-09-28 10:07:20 -070037#include <utils/Log.h>
38#include <utils/String16.h>
Andres Morales2d08dce2015-04-03 16:40:15 -070039
Andres Morales33dfdc72015-05-12 15:37:20 -070040#include "SoftGateKeeperDevice.h"
Andres Morales1cf7d252015-08-04 16:57:12 -070041#include "IUserManager.h"
Andres Morales33dfdc72015-05-12 15:37:20 -070042
Alexey Polyudov275aece2016-10-18 13:59:26 -070043#include <hidl/HidlSupport.h>
44#include <android/hardware/gatekeeper/1.0/IGatekeeper.h>
45
46using android::sp;
47using android::hardware::gatekeeper::V1_0::IGatekeeper;
48using android::hardware::gatekeeper::V1_0::GatekeeperStatusCode;
49using android::hardware::gatekeeper::V1_0::GatekeeperResponse;
50using android::hardware::Return;
51
Andres Morales2d08dce2015-04-03 16:40:15 -070052namespace android {
53
54static const String16 KEYGUARD_PERMISSION("android.permission.ACCESS_KEYGUARD_SECURE_STORAGE");
55static const String16 DUMP_PERMISSION("android.permission.DUMP");
56
57class GateKeeperProxy : public BnGateKeeperService {
58public:
59 GateKeeperProxy() {
Adrian Rooscb4ed1b2017-04-12 13:03:04 -070060 clear_state_if_needed_done = false;
Chris Phoenixa84ce0c2017-01-24 13:09:39 -080061 hw_device = IGatekeeper::getService();
Andres Moralesfef908e2015-07-07 10:28:15 -070062
Alexey Polyudov275aece2016-10-18 13:59:26 -070063 if (hw_device == nullptr) {
Andres Morales33dfdc72015-05-12 15:37:20 -070064 ALOGW("falling back to software GateKeeper");
65 soft_device.reset(new SoftGateKeeperDevice());
Andres Morales33dfdc72015-05-12 15:37:20 -070066 }
Andres Morales2d08dce2015-04-03 16:40:15 -070067 }
68
69 virtual ~GateKeeperProxy() {
Andres Morales2d08dce2015-04-03 16:40:15 -070070 }
71
Andres Morales6a49c2f2015-04-16 13:16:24 -070072 void store_sid(uint32_t uid, uint64_t sid) {
73 char filename[21];
George Burgess IVe7aa2b22016-03-02 14:02:55 -080074 snprintf(filename, sizeof(filename), "%u", uid);
Andres Morales6a49c2f2015-04-16 13:16:24 -070075 int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
76 if (fd < 0) {
Andres Moralesdcb3fbd2015-04-17 09:00:28 -070077 ALOGE("could not open file: %s: %s", filename, strerror(errno));
Andres Morales6a49c2f2015-04-16 13:16:24 -070078 return;
79 }
80 write(fd, &sid, sizeof(sid));
81 close(fd);
82 }
83
Adrian Rooscb4ed1b2017-04-12 13:03:04 -070084 void clear_state_if_needed() {
85 if (clear_state_if_needed_done) {
86 return;
87 }
88
89 if (mark_cold_boot()) {
90 ALOGI("cold boot: clearing state");
91 if (hw_device != nullptr) {
92 hw_device->deleteAllUsers([](const GatekeeperResponse &){});
93 }
94 }
95
96 clear_state_if_needed_done = true;
97 }
98
Andres Morales3c2086d2015-06-24 10:21:16 -070099 bool mark_cold_boot() {
100 const char *filename = ".coldboot";
101 if (access(filename, F_OK) == -1) {
102 int fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
103 if (fd < 0) {
104 ALOGE("could not open file: %s : %s", filename, strerror(errno));
105 return false;
106 }
107 close(fd);
108 return true;
109 }
110 return false;
111 }
112
Andres Morales6a49c2f2015-04-16 13:16:24 -0700113 void maybe_store_sid(uint32_t uid, uint64_t sid) {
114 char filename[21];
George Burgess IVe7aa2b22016-03-02 14:02:55 -0800115 snprintf(filename, sizeof(filename), "%u", uid);
Andres Morales6a49c2f2015-04-16 13:16:24 -0700116 if (access(filename, F_OK) == -1) {
117 store_sid(uid, sid);
118 }
119 }
120
121 uint64_t read_sid(uint32_t uid) {
122 char filename[21];
123 uint64_t sid;
George Burgess IVe7aa2b22016-03-02 14:02:55 -0800124 snprintf(filename, sizeof(filename), "%u", uid);
Andres Morales6a49c2f2015-04-16 13:16:24 -0700125 int fd = open(filename, O_RDONLY);
126 if (fd < 0) return 0;
127 read(fd, &sid, sizeof(sid));
Andres Morales0b0435e2015-07-10 09:47:09 -0700128 close(fd);
Andres Morales6a49c2f2015-04-16 13:16:24 -0700129 return sid;
130 }
131
Andres Moralesdcb3fbd2015-04-17 09:00:28 -0700132 void clear_sid(uint32_t uid) {
133 char filename[21];
George Burgess IVe7aa2b22016-03-02 14:02:55 -0800134 snprintf(filename, sizeof(filename), "%u", uid);
Andres Moralesdcb3fbd2015-04-17 09:00:28 -0700135 if (remove(filename) < 0) {
136 ALOGE("%s: could not remove file [%s], attempting 0 write", __func__, strerror(errno));
137 store_sid(uid, 0);
138 }
139 }
140
Andres Moralesae242922015-05-18 09:26:19 -0700141 virtual int enroll(uint32_t uid,
Andres Morales2d08dce2015-04-03 16:40:15 -0700142 const uint8_t *current_password_handle, uint32_t current_password_handle_length,
143 const uint8_t *current_password, uint32_t current_password_length,
144 const uint8_t *desired_password, uint32_t desired_password_length,
145 uint8_t **enrolled_password_handle, uint32_t *enrolled_password_handle_length) {
146 IPCThreadState* ipc = IPCThreadState::self();
147 const int calling_pid = ipc->getCallingPid();
148 const int calling_uid = ipc->getCallingUid();
149 if (!PermissionCache::checkPermission(KEYGUARD_PERMISSION, calling_pid, calling_uid)) {
150 return PERMISSION_DENIED;
151 }
152
Adrian Rooscb4ed1b2017-04-12 13:03:04 -0700153 // Make sure to clear any state from before factory reset as soon as a credential is
154 // enrolled (which may happen during device setup).
155 clear_state_if_needed();
156
Andres Morales2d08dce2015-04-03 16:40:15 -0700157 // need a desired password to enroll
158 if (desired_password_length == 0) return -EINVAL;
Andres Morales33dfdc72015-05-12 15:37:20 -0700159
160 int ret;
Alexey Polyudov275aece2016-10-18 13:59:26 -0700161 if (hw_device != nullptr) {
Andres Morales835d96e2015-06-03 15:06:24 -0700162 const gatekeeper::password_handle_t *handle =
163 reinterpret_cast<const gatekeeper::password_handle_t *>(current_password_handle);
164
Andres Morales7f6dcf62015-06-24 18:40:24 -0700165 if (handle != NULL && handle->version != 0 && !handle->hardware_backed) {
Andres Morales835d96e2015-06-03 15:06:24 -0700166 // handle is being re-enrolled from a software version. HAL probably won't accept
167 // the handle as valid, so we nullify it and enroll from scratch
168 current_password_handle = NULL;
169 current_password_handle_length = 0;
170 current_password = NULL;
171 current_password_length = 0;
172 }
173
Alexey Polyudov275aece2016-10-18 13:59:26 -0700174 android::hardware::hidl_vec<uint8_t> curPwdHandle;
175 curPwdHandle.setToExternal(const_cast<uint8_t*>(current_password_handle),
176 current_password_handle_length);
177 android::hardware::hidl_vec<uint8_t> curPwd;
178 curPwd.setToExternal(const_cast<uint8_t*>(current_password),
179 current_password_length);
180 android::hardware::hidl_vec<uint8_t> newPwd;
181 newPwd.setToExternal(const_cast<uint8_t*>(desired_password),
182 desired_password_length);
183
184 Return<void> hwRes = hw_device->enroll(uid, curPwdHandle, curPwd, newPwd,
185 [&ret, enrolled_password_handle, enrolled_password_handle_length]
186 (const GatekeeperResponse &rsp) {
187 ret = static_cast<int>(rsp.code); // propagate errors
188 if (rsp.code >= GatekeeperStatusCode::STATUS_OK) {
189 if (enrolled_password_handle != nullptr &&
190 enrolled_password_handle_length != nullptr) {
191 *enrolled_password_handle = new uint8_t[rsp.data.size()];
192 *enrolled_password_handle_length = rsp.data.size();
193 memcpy(*enrolled_password_handle, rsp.data.data(),
194 *enrolled_password_handle_length);
195 }
196 ret = 0; // all success states are reported as 0
197 } else if (rsp.code == GatekeeperStatusCode::ERROR_RETRY_TIMEOUT && rsp.timeout > 0) {
198 ret = rsp.timeout;
199 }
200 });
Steven Moreland81330932017-01-03 17:01:27 -0800201 if (!hwRes.isOk()) {
Alexey Polyudov275aece2016-10-18 13:59:26 -0700202 ALOGE("enroll transaction failed\n");
203 ret = -1;
204 }
Andres Morales33dfdc72015-05-12 15:37:20 -0700205 } else {
206 ret = soft_device->enroll(uid,
207 current_password_handle, current_password_handle_length,
208 current_password, current_password_length,
209 desired_password, desired_password_length,
210 enrolled_password_handle, enrolled_password_handle_length);
211 }
212
Alexey Polyudov8c635362016-09-07 18:51:28 -0700213 if (ret == GATEKEEPER_RESPONSE_OK && (*enrolled_password_handle == nullptr ||
214 *enrolled_password_handle_length != sizeof(password_handle_t))) {
215 ret = GATEKEEPER_RESPONSE_ERROR;
216 ALOGE("HAL: password_handle=%p size_of_handle=%" PRIu32 "\n",
217 *enrolled_password_handle, *enrolled_password_handle_length);
218 }
219
220 if (ret == GATEKEEPER_RESPONSE_OK) {
Andres Morales6a49c2f2015-04-16 13:16:24 -0700221 gatekeeper::password_handle_t *handle =
222 reinterpret_cast<gatekeeper::password_handle_t *>(*enrolled_password_handle);
223 store_sid(uid, handle->user_id);
Andres Morales531e3e82015-06-01 17:23:04 -0700224 bool rr;
225
226 // immediately verify this password so we don't ask the user to enter it again
227 // if they just created it.
228 verify(uid, *enrolled_password_handle, sizeof(password_handle_t), desired_password,
229 desired_password_length, &rr);
Andres Morales6a49c2f2015-04-16 13:16:24 -0700230 }
Andres Moralesae242922015-05-18 09:26:19 -0700231
232 return ret;
Andres Morales2d08dce2015-04-03 16:40:15 -0700233 }
234
Andres Moralesae242922015-05-18 09:26:19 -0700235 virtual int verify(uint32_t uid,
Andres Morales2d08dce2015-04-03 16:40:15 -0700236 const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
Andres Moralesae242922015-05-18 09:26:19 -0700237 const uint8_t *provided_password, uint32_t provided_password_length, bool *request_reenroll) {
Andres Moralesc828ae82015-04-10 21:03:07 -0700238 uint8_t *auth_token;
239 uint32_t auth_token_length;
240 return verifyChallenge(uid, 0, enrolled_password_handle, enrolled_password_handle_length,
241 provided_password, provided_password_length,
Andres Moralesae242922015-05-18 09:26:19 -0700242 &auth_token, &auth_token_length, request_reenroll);
Andres Moralesc828ae82015-04-10 21:03:07 -0700243 }
244
Andres Moralesae242922015-05-18 09:26:19 -0700245 virtual int verifyChallenge(uint32_t uid, uint64_t challenge,
Andres Moralesc828ae82015-04-10 21:03:07 -0700246 const uint8_t *enrolled_password_handle, uint32_t enrolled_password_handle_length,
247 const uint8_t *provided_password, uint32_t provided_password_length,
Andres Moralesae242922015-05-18 09:26:19 -0700248 uint8_t **auth_token, uint32_t *auth_token_length, bool *request_reenroll) {
Andres Morales2d08dce2015-04-03 16:40:15 -0700249 IPCThreadState* ipc = IPCThreadState::self();
250 const int calling_pid = ipc->getCallingPid();
251 const int calling_uid = ipc->getCallingUid();
252 if (!PermissionCache::checkPermission(KEYGUARD_PERMISSION, calling_pid, calling_uid)) {
253 return PERMISSION_DENIED;
254 }
255
256 // can't verify if we're missing either param
257 if ((enrolled_password_handle_length | provided_password_length) == 0)
258 return -EINVAL;
259
Andres Morales33dfdc72015-05-12 15:37:20 -0700260 int ret;
Alexey Polyudov275aece2016-10-18 13:59:26 -0700261 if (hw_device != nullptr) {
Andres Morales835d96e2015-06-03 15:06:24 -0700262 const gatekeeper::password_handle_t *handle =
263 reinterpret_cast<const gatekeeper::password_handle_t *>(enrolled_password_handle);
Andres Morales7f6dcf62015-06-24 18:40:24 -0700264 // handle version 0 does not have hardware backed flag, and thus cannot be upgraded to
265 // a HAL if there was none before
266 if (handle->version == 0 || handle->hardware_backed) {
Alexey Polyudov275aece2016-10-18 13:59:26 -0700267 android::hardware::hidl_vec<uint8_t> curPwdHandle;
268 curPwdHandle.setToExternal(const_cast<uint8_t*>(enrolled_password_handle),
269 enrolled_password_handle_length);
270 android::hardware::hidl_vec<uint8_t> enteredPwd;
271 enteredPwd.setToExternal(const_cast<uint8_t*>(provided_password),
272 provided_password_length);
273 Return<void> hwRes = hw_device->verify(uid, challenge, curPwdHandle, enteredPwd,
274 [&ret, request_reenroll, auth_token, auth_token_length]
275 (const GatekeeperResponse &rsp) {
276 ret = static_cast<int>(rsp.code); // propagate errors
277 if (auth_token != nullptr && auth_token_length != nullptr &&
278 rsp.code >= GatekeeperStatusCode::STATUS_OK) {
279 *auth_token = new uint8_t[rsp.data.size()];
280 *auth_token_length = rsp.data.size();
281 memcpy(*auth_token, rsp.data.data(), *auth_token_length);
282 if (request_reenroll != nullptr) {
283 *request_reenroll = (rsp.code == GatekeeperStatusCode::STATUS_REENROLL);
284 }
285 ret = 0; // all success states are reported as 0
286 } else if (rsp.code == GatekeeperStatusCode::ERROR_RETRY_TIMEOUT &&
287 rsp.timeout > 0) {
288 ret = rsp.timeout;
289 }
290 });
Steven Moreland81330932017-01-03 17:01:27 -0800291 if (!hwRes.isOk()) {
Alexey Polyudov275aece2016-10-18 13:59:26 -0700292 ALOGE("verify transaction failed\n");
293 ret = -1;
294 }
Andres Morales835d96e2015-06-03 15:06:24 -0700295 } else {
296 // upgrade scenario, a HAL has been added to this device where there was none before
297 SoftGateKeeperDevice soft_dev;
298 ret = soft_dev.verify(uid, challenge,
299 enrolled_password_handle, enrolled_password_handle_length,
300 provided_password, provided_password_length, auth_token, auth_token_length,
301 request_reenroll);
302
303 if (ret == 0) {
304 // success! re-enroll with HAL
305 *request_reenroll = true;
306 }
307 }
Andres Morales33dfdc72015-05-12 15:37:20 -0700308 } else {
309 ret = soft_device->verify(uid, challenge,
310 enrolled_password_handle, enrolled_password_handle_length,
Andres Moralesae242922015-05-18 09:26:19 -0700311 provided_password, provided_password_length, auth_token, auth_token_length,
312 request_reenroll);
Andres Morales33dfdc72015-05-12 15:37:20 -0700313 }
Andres Morales2d08dce2015-04-03 16:40:15 -0700314
Andres Moralesae242922015-05-18 09:26:19 -0700315 if (ret == 0 && *auth_token != NULL && *auth_token_length > 0) {
Andres Morales2d08dce2015-04-03 16:40:15 -0700316 // TODO: cache service?
317 sp<IServiceManager> sm = defaultServiceManager();
318 sp<IBinder> binder = sm->getService(String16("android.security.keystore"));
319 sp<IKeystoreService> service = interface_cast<IKeystoreService>(binder);
320 if (service != NULL) {
Janis Danisevskis72030fb2016-10-24 14:47:00 +0100321 auto ret = service->addAuthToken(*auth_token, *auth_token_length);
322 if (!ret.isOk()) {
323 ALOGE("Failure sending auth token to KeyStore: %" PRId32, int32_t(ret));
Andres Morales2d08dce2015-04-03 16:40:15 -0700324 }
325 } else {
326 ALOGE("Unable to communicate with KeyStore");
327 }
328 }
329
Andres Moralesae242922015-05-18 09:26:19 -0700330 if (ret == 0) {
Andres Morales6a49c2f2015-04-16 13:16:24 -0700331 maybe_store_sid(uid, reinterpret_cast<const gatekeeper::password_handle_t *>(
332 enrolled_password_handle)->user_id);
Andres Morales6a49c2f2015-04-16 13:16:24 -0700333 }
334
Andres Moralesae242922015-05-18 09:26:19 -0700335 return ret;
Andres Morales6a49c2f2015-04-16 13:16:24 -0700336 }
337
338 virtual uint64_t getSecureUserId(uint32_t uid) {
Andres Morales1cf7d252015-08-04 16:57:12 -0700339 uint64_t sid = read_sid(uid);
340 if (sid == 0) {
341 // might be a work profile, look up the parent
342 sp<IServiceManager> sm = defaultServiceManager();
343 sp<IBinder> binder = sm->getService(String16("user"));
344 sp<IUserManager> um = interface_cast<IUserManager>(binder);
345 int32_t parent = um->getCredentialOwnerProfile(uid);
346 if (parent < 0) {
347 return 0;
348 } else if (parent != (int32_t) uid) {
349 return read_sid(parent);
350 }
351 }
352 return sid;
353
Andres Morales2d08dce2015-04-03 16:40:15 -0700354 }
355
Andres Morales7c9c3bc2015-04-16 15:57:17 -0700356 virtual void clearSecureUserId(uint32_t uid) {
357 IPCThreadState* ipc = IPCThreadState::self();
358 const int calling_pid = ipc->getCallingPid();
359 const int calling_uid = ipc->getCallingUid();
360 if (!PermissionCache::checkPermission(KEYGUARD_PERMISSION, calling_pid, calling_uid)) {
361 ALOGE("%s: permission denied for [%d:%d]", __func__, calling_pid, calling_uid);
362 return;
363 }
Andres Moralesdcb3fbd2015-04-17 09:00:28 -0700364 clear_sid(uid);
Andres Morales3c2086d2015-06-24 10:21:16 -0700365
Alexey Polyudov275aece2016-10-18 13:59:26 -0700366 if (hw_device != nullptr) {
367 hw_device->deleteUser(uid, [] (const GatekeeperResponse &){});
Andres Morales3c2086d2015-06-24 10:21:16 -0700368 }
Andres Morales7c9c3bc2015-04-16 15:57:17 -0700369 }
370
Adrian Rooscb4ed1b2017-04-12 13:03:04 -0700371 virtual void reportDeviceSetupComplete() {
372 IPCThreadState* ipc = IPCThreadState::self();
373 const int calling_pid = ipc->getCallingPid();
374 const int calling_uid = ipc->getCallingUid();
375 if (!PermissionCache::checkPermission(KEYGUARD_PERMISSION, calling_pid, calling_uid)) {
376 ALOGE("%s: permission denied for [%d:%d]", __func__, calling_pid, calling_uid);
377 return;
378 }
379
380 clear_state_if_needed();
381 }
382
Andres Morales2d08dce2015-04-03 16:40:15 -0700383 virtual status_t dump(int fd, const Vector<String16> &) {
384 IPCThreadState* ipc = IPCThreadState::self();
385 const int pid = ipc->getCallingPid();
386 const int uid = ipc->getCallingUid();
387 if (!PermissionCache::checkPermission(DUMP_PERMISSION, pid, uid)) {
388 return PERMISSION_DENIED;
389 }
390
Alexey Polyudov275aece2016-10-18 13:59:26 -0700391 if (hw_device == NULL) {
Andres Morales2d08dce2015-04-03 16:40:15 -0700392 const char *result = "Device not available";
393 write(fd, result, strlen(result) + 1);
394 } else {
395 const char *result = "OK";
396 write(fd, result, strlen(result) + 1);
397 }
398
399 return NO_ERROR;
400 }
401
402private:
Alexey Polyudov275aece2016-10-18 13:59:26 -0700403 sp<IGatekeeper> hw_device;
Justin Yun919cc552017-08-16 18:54:20 +0900404 std::unique_ptr<SoftGateKeeperDevice> soft_device;
Adrian Rooscb4ed1b2017-04-12 13:03:04 -0700405
406 bool clear_state_if_needed_done;
Andres Morales2d08dce2015-04-03 16:40:15 -0700407};
408}// namespace android
409
Andres Morales6a49c2f2015-04-16 13:16:24 -0700410int main(int argc, char* argv[]) {
Andres Morales2d08dce2015-04-03 16:40:15 -0700411 ALOGI("Starting gatekeeperd...");
Andres Morales6a49c2f2015-04-16 13:16:24 -0700412 if (argc < 2) {
413 ALOGE("A directory must be specified!");
414 return 1;
415 }
416 if (chdir(argv[1]) == -1) {
417 ALOGE("chdir: %s: %s", argv[1], strerror(errno));
418 return 1;
419 }
420
Andres Morales2d08dce2015-04-03 16:40:15 -0700421 android::sp<android::IServiceManager> sm = android::defaultServiceManager();
422 android::sp<android::GateKeeperProxy> proxy = new android::GateKeeperProxy();
423 android::status_t ret = sm->addService(
424 android::String16("android.service.gatekeeper.IGateKeeperService"), proxy);
425 if (ret != android::OK) {
426 ALOGE("Couldn't register binder service!");
427 return -1;
428 }
429
430 /*
431 * We're the only thread in existence, so we're just going to process
432 * Binder transaction as a single-threaded program.
433 */
434 android::IPCThreadState::self()->joinThreadPool();
435 return 0;
436}