From a170919d1b670f531f31192bef4dff08be636a7c Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Sun, 25 Jan 2026 17:07:20 +0100 Subject: [PATCH] android/binder: use same_thread_group(proc->tsk, current) in binder_mmap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alice Ryhl Cc: Boris Brezillon Cc: Christan König Cc: David S. Miller Cc: Eric Dumazet Cc: Felix Kuehling Cc: Jakub Kicinski Cc: Leon Romanovsky Cc: Paolo Abeni Cc: Simon Horman Cc: Steven Price Signed-off-by: Andrew Morton --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index dea701daabb02..b3b73303f84dc 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6015,7 +6015,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma) { struct binder_proc *proc = filp->private_data; - if (proc->tsk != current->group_leader) + if (!same_thread_group(proc->tsk, current)) return -EINVAL; binder_debug(BINDER_DEBUG_OPEN_CLOSE, -- 2.47.3