From 5d7100a43bc030a42b9084dfded7f17d8e2f8286 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 6 Jul 2022 21:48:46 +0000 Subject: [PATCH] Binder: clearCallingIdentity is kernel binder This method clears the calling identity of a kernel binder call. However, there is now a generic API to disallow the use of kernel binder calling identities. This is used by RPC binder calls in order to ensure that code doesn't accidentally assume the default (, ) calling identity means that the call originated from another process. In the C++ layer, this API is attached to IPCThreadState. In the future, we could consider expanding the scope of this API to code and restore many types of calling IDs, but the current return type may not have enough space, and I want to push people away from thread locals (globals) for now. Bug: 237245600 Test: N/A Change-Id: I6e293814769cbd3c41e72afd95385af31ceb099f --- core/java/android/os/Binder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/Binder.java b/core/java/android/os/Binder.java index 59db8f495dd9b..a7c7ce2291db1 100644 --- a/core/java/android/os/Binder.java +++ b/core/java/android/os/Binder.java @@ -350,7 +350,7 @@ public class Binder implements IBinder { } /** - * Reset the identity of the incoming IPC on the current thread. This can + * Reset the kernel binder identity of the incoming IPC on the current thread. This can * be useful if, while handling an incoming call, you will be calling * on interfaces of other objects that may be local to your process and * need to do permission checks on the calls coming into them (so they @@ -369,7 +369,7 @@ public class Binder implements IBinder { public static final native long clearCallingIdentity(); /** - * Restore the identity of the incoming IPC on the current thread + * Restore the kernel binder identity of the incoming IPC on the current thread * back to a previously identity that was returned by {@link * #clearCallingIdentity}. *