]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
binder: avoid potential data leakage when copying txn
authorTodd Kjos <tkjos@google.com>
Wed, 30 Nov 2022 03:58:00 +0000 (03:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:04 +0000 (17:40 +0100)
commit23e9d815fad84c1bee3742a8de4bd39510435362
tree842b2b2ff1d679d2af60cffb489e0132f3797437
parent22870431cd250df3eec96753d9422bfc9f0d52a4
binder: avoid potential data leakage when copying txn

commit 6d98eb95b450a75adb4516a1d33652dc78d2b20c upstream.

Transactions are copied from the sender to the target
first and objects like BINDER_TYPE_PTR and BINDER_TYPE_FDA
are then fixed up. This means there is a short period where
the sender's version of these objects are visible to the
target prior to the fixups.

Instead of copying all of the data first, copy data only
after any needed fixups have been applied.

Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
Reviewed-by: Martijn Coenen <maco@android.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Todd Kjos <tkjos@google.com>
Link: https://lore.kernel.org/r/20211130185152.437403-3-tkjos@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[cmllamas: fix trivial merge conflict]
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c