Skip to content

Commit a170919

Browse files
oleg-nesterovakpm00
authored andcommitted
android/binder: use same_thread_group(proc->tsk, current) in binder_mmap()
With or without this change the checked condition can be falsely true if proc->tsk execs, but this is fine: binder_alloc_mmap_handler() checks vma->vm_mm == alloc->mm. Link: https://lkml.kernel.org/r/aXY_uPYyUg4rwNOg@redhat.com Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Christan König <christian.koenig@amd.com> Cc: David S. Miller <davem@davemloft.net> Cc: Eric Dumazet <edumazet@google.com> Cc: Felix Kuehling <felix.kuehling@amd.com> Cc: Jakub Kicinski <kuba@kernel.org> Cc: Leon Romanovsky <leon@kernel.org> Cc: Paolo Abeni <pabeni@redhat.com> Cc: Simon Horman <horms@kernel.org> Cc: Steven Price <steven.price@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 33caa19 commit a170919

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/android/binder.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
60156015
{
60166016
struct binder_proc *proc = filp->private_data;
60176017

6018-
if (proc->tsk != current->group_leader)
6018+
if (!same_thread_group(proc->tsk, current))
60196019
return -EINVAL;
60206020

60216021
binder_debug(BINDER_DEBUG_OPEN_CLOSE,

0 commit comments

Comments
 (0)