From nobody Sat Feb 7 11:31:42 2026 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2B5B324B16 for ; Sun, 25 Jan 2026 16:07:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769357248; cv=none; b=dJb6X12POf1vs1ScSmFnmi+mB7CiG/XI/U83/RJkU5SnGxvNsxRih6rprQDJCHwt/mbyRLZaNuItHQ79YkiW3XnK0T2erILF8ccbRmT9b3+jOIJB60zQ3cpIxrxl13he0HgnQqoi6bg8iE8AMg3wLEuGmWlinXObp27t5vZOzOs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769357248; c=relaxed/simple; bh=1JQUHjZYL59DmrAabDgnZXBTuRE0Rrr0TT0qVpO3zE4=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=R75yUCuwlxFg3Xi9mF5RE6syfwylXoW6+YD/EWiSKYA5admZ2y8KWTisZXteiQQIKqjZdlO5aDzYlZGPAsT0bIh4YrNReF3Go8VC2F5/haaykxoxM5d7jtMphYV8VdypBjrJKRL2uV1Ey5Koa6ZjtiiN/LcFov0vzkrQP1AnqAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gULGtUVE; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gULGtUVE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769357245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=xB97zLe11SZtUlvoaULtcDCkHx3T3uK2AQMcqJMNJHc=; b=gULGtUVEVg4D5DI5SEr38nTWHb3GhfRW7OyeemiWmx7r+2PyWeYsoKPq8Nw3D5pmxeFubl DJ7KVxb3wknyVgE9l2od+p0ZdztJw+sxxSUl1fAQyRzHo1IoK1DNJ1fCSCrtKvbW6vJpds dbHCYhI/dH03qhvMQZmauEkjiVcuxB4= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-MV5s2csbO0WMU3OsplZ8Kg-1; Sun, 25 Jan 2026 11:07:22 -0500 X-MC-Unique: MV5s2csbO0WMU3OsplZ8Kg-1 X-Mimecast-MFC-AGG-ID: MV5s2csbO0WMU3OsplZ8Kg_1769357240 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EF0C119560B5; Sun, 25 Jan 2026 16:07:19 +0000 (UTC) Received: from fedora (unknown [10.45.224.8]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 69D1B30001A7; Sun, 25 Jan 2026 16:07:13 +0000 (UTC) Received: by fedora (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 25 Jan 2026 17:07:19 +0100 (CET) Date: Sun, 25 Jan 2026 17:07:11 +0100 From: Oleg Nesterov To: Andrew Morton Cc: Alice Ryhl , Boris Brezillon , Christian =?iso-8859-1?Q?K=F6nig?= , Felix Kuehling , Leon Romanovsky , Steven Price , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 1/7] android/binder: don't abuse current->group_leader Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Cleanup and preparation to simplify the next changes. - Use current->tgid instead of current->group_leader->pid - Use the value returned by get_task_struct() to initialize proc->tsk Signed-off-by: Oleg Nesterov Reviewed-by: Alice Ryhl --- drivers/android/binder.c | 7 +++---- drivers/android/binder_alloc.c | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 535fc881c8da..dea701daabb0 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6046,7 +6046,7 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) bool existing_pid =3D false; =20 binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__, - current->group_leader->pid, current->pid); + current->tgid, current->pid); =20 proc =3D kzalloc(sizeof(*proc), GFP_KERNEL); if (proc =3D=3D NULL) @@ -6055,8 +6055,8 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) dbitmap_init(&proc->dmap); spin_lock_init(&proc->inner_lock); spin_lock_init(&proc->outer_lock); - get_task_struct(current->group_leader); - proc->tsk =3D current->group_leader; + proc->tsk =3D get_task_struct(current->group_leader); + proc->pid =3D current->tgid; proc->cred =3D get_cred(filp->f_cred); INIT_LIST_HEAD(&proc->todo); init_waitqueue_head(&proc->freeze_wait); @@ -6075,7 +6075,6 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) binder_alloc_init(&proc->alloc); =20 binder_stats_created(BINDER_STAT_PROC); - proc->pid =3D current->group_leader->pid; INIT_LIST_HEAD(&proc->delivered_death); INIT_LIST_HEAD(&proc->delivered_freeze); INIT_LIST_HEAD(&proc->waiting_threads); diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 979c96b74cad..145ed5f14cdb 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -1233,7 +1233,7 @@ static struct shrinker *binder_shrinker; VISIBLE_IF_KUNIT void __binder_alloc_init(struct binder_alloc *alloc, struct list_lru *freelist) { - alloc->pid =3D current->group_leader->pid; + alloc->pid =3D current->tgid; alloc->mm =3D current->mm; mmgrab(alloc->mm); mutex_init(&alloc->mutex); --=20 2.52.0