]> Git Repo - linux.git/commit
binder: prevent UAF read in print_binder_transaction_log_entry()
authorChristian Brauner <[email protected]>
Tue, 8 Oct 2019 13:01:59 +0000 (15:01 +0200)
committerGreg Kroah-Hartman <[email protected]>
Thu, 10 Oct 2019 12:39:22 +0000 (14:39 +0200)
commit51d8a7eca67784b155a07aeab4bfb9f63ebaaf9e
tree8a4c36a4e4c90fe082121c682ff13c101562d28d
parentfc739a058d99c9297ef6bfd923b809d85855b9a9
binder: prevent UAF read in print_binder_transaction_log_entry()

When a binder transaction is initiated on a binder device coming from a
binderfs instance, a pointer to the name of the binder device is stashed
in the binder_transaction_log_entry's context_name member. Later on it
is used to print the name in print_binder_transaction_log_entry(). By
the time print_binder_transaction_log_entry() accesses context_name
binderfs_evict_inode() might have already freed the associated memory
thereby causing a UAF. Do the simple thing and prevent this by copying
the name of the binder device instead of stashing a pointer to it.

Reported-by: Jann Horn <[email protected]>
Fixes: 03e2e07e3814 ("binder: Make transaction_log available in binderfs")
Link: https://lore.kernel.org/r/CAG48ez14Q0-F8LqsvcNbyR2o6gPW8SHXsm4u5jmD9MpsteM2Tw@mail.gmail.com
Signed-off-by: Christian Brauner <[email protected]>
Reviewed-by: Joel Fernandes (Google) <[email protected]>
Acked-by: Todd Kjos <[email protected]>
Reviewed-by: Hridya Valsaraju <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/android/binder.c
drivers/android/binder_internal.h
This page took 0.050804 seconds and 4 git commands to generate.