From nobody Fri Dec 19 06:33:53 2025 Received: from spam.asrmicro.com (asrmicro.com [210.13.118.86]) (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 74EB3127E18 for ; Tue, 29 Apr 2025 07:50:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.13.118.86 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745913056; cv=none; b=d5uW6DbyXDvk2CMcXRah3+8QL9aSeA57PYFMdOSv+hH2+NWu5OI1pFumwxyYzI+914gKgBY+N1lj0UvbZmFhcqceKd+JHyriaihPBIz68N68nI8tjIh6SWtt8R9q5g5VwQYP5bPUkTlRRTBrqQK2kP8D+jOIgeMX/ioKBGKN5RU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745913056; c=relaxed/simple; bh=Nvb2gPai4A+s/3qme+cxcbZehIbNW24hp2k44LYLMts=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=dN/c+BnBLA1HrTrTtBdRdTn4qldLvaeDnYk0Dq/yntkpA90r4Tt2qkQ26xOf2WbFf9AxaucEucgL1hDFTlLCVpGLv79wB5e1v2Xh8oERdCVzRPma0G46fiBd8q+8UzgBXQOKoM7dlvurrQAguWWFRRBS0PRs35aAilm7LeDpFEA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=asrmicro.com; spf=pass smtp.mailfrom=asrmicro.com; arc=none smtp.client-ip=210.13.118.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=asrmicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asrmicro.com Received: from exch03.asrmicro.com (exch03.asrmicro.com [10.1.24.118]) by spam.asrmicro.com with ESMTPS id 53T7oTFd037789 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 29 Apr 2025 15:50:29 +0800 (GMT-8) (envelope-from zhengyan@asrmicro.com) Received: from localhost (10.1.170.252) by exch03.asrmicro.com (10.1.24.118) with Microsoft SMTP Server (TLS) id 15.0.847.32; Tue, 29 Apr 2025 15:50:32 +0800 From: zhengyan To: CC: , , , , , , , , zhengyan Subject: [PATCH] binder: skip dead binder_proc during binder_open Date: Tue, 29 Apr 2025 07:50:30 +0000 Message-ID: <20250429075030.305-1-zhengyan@asrmicro.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-DNSRBL: X-SPAM-SOURCE-CHECK: pass X-MAIL: spam.asrmicro.com 53T7oTFd037789 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" During binder_open, the binder_proc list is travesed to check for the existing binder_proc instances. binder_proc objects are async released in a deferred work after binder_release, and may remain temporarily on the binder_procs list even after being marked as dead. Without checking the flag, binder_open may face a crash as "Unable to handle kernel paging request at virtual address dead000000000140" Signed-off-by: zhengyan --- drivers/android/binder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 76052006bd87..43ab4350e589 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -6041,6 +6041,8 @@ static int binder_open(struct inode *nodp, struct fil= e *filp) =20 mutex_lock(&binder_procs_lock); hlist_for_each_entry(itr, &binder_procs, proc_node) { + if (itr->is_dead) + continue; if (itr->pid =3D=3D proc->pid) { existing_pid =3D true; break; --=20 2.25.1