From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96AAF1F3D23 for ; Tue, 7 Jan 2025 21:41:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736286091; cv=none; b=QTX1u3BnmnmnApr7fk8lipbHGrddpwrMToUEoIh65D2Ro8p7s+ppGWd7ACXE1B5J1pfyJXQ2O/fGYzgQM3rOfNmI+5URNiN+A6UQwFdCgzfCCgMW4RzoXw4Ggds+UgopI6YtGg6VWqsbwuDXQU2LfooGWT8OT3cygqAt+aeeAyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736286091; c=relaxed/simple; bh=lpWKviEZo4bxM8FXJ8znVcvZY1r1EUP8KwYPFjPwLkY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I4UPLTQTCLhPmMOP7+jqsVUaIpOtVnM4VvRRhD4hCdWypmFmPgiAio0pUt35ZaA/a2ppGMHKTdhRSCJjMYbi1qJAaha8LecZfdjixzpqmsJNfKFlGwrZEWtQhm2+G4oNR2wxdZvFidcSMoxSNuqUsttnFFk/c+SkrSes2FwnGXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=rJKqu2bQ; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rJKqu2bQ" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-215740b7fb8so39895ad.0 for ; Tue, 07 Jan 2025 13:41:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1736286089; x=1736890889; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=unXEBPo8awHZ2Z1rF9jBBJWiHGlrbX40mqZQQ+A6Pko=; b=rJKqu2bQcea7guTbC2FPbTVj9vl7Z3T9HB6kDwRdZKmW+kRcuM6s+EPqNkETQfNZTC OICOgzg9L7NWOiMGE0AY5AqWgw02vSjz3YNRZJSagIxo/yKFQ0TGDjyEmUTSlc0Gza9A vrcMD4pzlGRLS9tZfp7JxJrx4FZUZwkGFIA4kUJgykw82p0/Y51UrqWLrO9cweULhQOv D7xay0ikT0Y8lbTIcubMdjad84oGj8wEo0Ie56+DWxwXP+j9ZeOw0ZCrCpyUEJSK2Wgv u17tyOkwZ5XrKw8ouzRHbqGurmd4+ecneGnoEeckw2qbTBTO0q3/3cwi4DaiFma57+eY /j2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736286089; x=1736890889; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=unXEBPo8awHZ2Z1rF9jBBJWiHGlrbX40mqZQQ+A6Pko=; b=UCJGKh0/7aj5h/pgNAO4rCWPiq7hJIV09iyRinB22670RN2ta9um/Do+KZDRthuoOl GgjMJB3Cmi5dABu1JEcfzLQ/YfARtr6rNzrfaeO9TBMXpmZprWOOM2NoLqfha+xKFpSJ VJG+E84Aqol5XG1QwC6npWrkPCbSPSQpQCa7IG6u4Ac6voCwI05N/xnTyL8OE/AHyGgi 2wzxnl/z3Fay6OyejzHm29wrPz1o6qeLYp8GXZZRZ+KfM+HW+7IXfLhBu2Y4ltHdceAY CF0dXe6YObEuqTeHyNPXTrVt18YjxsC/l1wHRJv/d3ouXPytlSP6JB6qRXFk+KLXb7xX ya2A== X-Forwarded-Encrypted: i=1; AJvYcCW4rxc1tJkLACGRxHrHcmDLROOtmz2Zh/3USC31QTGTEhDqEn/5hfk6cL2Z3MEmv7L+LKdcn5/Gd+NeudY=@vger.kernel.org X-Gm-Message-State: AOJu0Yx2HW3qOqzshIkFttCVKyeCSPpKqXzYa6uKFalT/isApDt+YWhJ ZoDpiYQ1exdMohZ1o0MAw6ahxC+S3N0meZdFk7h2fXjMHIaKwJFmkYVbP8XDQg== X-Gm-Gg: ASbGncu590yotJeco0vYtaDMY5y+FvKfEUVr6U9XY6nJs17MQMOXIK5PN52xP/MpOMx yQz06e3PkFBPlMjP/t2VSmZjeDLOY3Ra1CyMWS5/glj1zqo/swP9U1ImJgufM/KeGJrCpg5GFc5 MsvLnhoHzaeuK3BQ6XDsiQMCV4puu2xiG8IQWR5WQ2Lxcb4YpmZkSTUdMHP1qbvbwx/p4S5w4BG JipH8X9PmKLGymAUDEg1AasAEx1z8lx9Nwd+cyyO5Zy2CJNlC8e6+6VPyt/7YroGfQ6pQemSOgS bkqWI0pYBVIkUlmonx8= X-Google-Smtp-Source: AGHT+IG3hEhfXeKWewYxbqr5NVyNbPqv0I027EJ/i4H/5/AUmYmTqt4fR8mqPv9GpwTbRhwaYzCZDw== X-Received: by 2002:a17:902:fa4f:b0:20c:f40e:6ec3 with SMTP id d9443c01a7336-21a84189e0emr559145ad.22.1736286088554; Tue, 07 Jan 2025 13:41:28 -0800 (PST) Received: from google.com (57.145.233.35.bc.googleusercontent.com. [35.233.145.57]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc963103sm316291215ad.52.2025.01.07.13.41.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 13:41:28 -0800 (PST) Date: Tue, 7 Jan 2025 21:41:24 +0000 From: Carlos Llamas To: Li Li Cc: dualli@google.com, corbet@lwn.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, donald.hunter@gmail.com, gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, brauner@kernel.org, surenb@google.com, arnd@arndb.de, masahiroy@kernel.org, bagasdotme@gmail.com, horms@kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, netdev@vger.kernel.org, hridya@google.com, smoreland@google.com, kernel-team@android.com Subject: Re: [PATCH v11 2/2] binder: report txn errors via generic netlink Message-ID: References: <20241218203740.4081865-1-dualli@chromium.org> <20241218203740.4081865-3-dualli@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 07, 2025 at 09:29:08PM +0000, Carlos Llamas wrote: > On Wed, Dec 18, 2024 at 12:37:40PM -0800, Li Li wrote: > > From: Li Li > > > @@ -6137,6 +6264,11 @@ static int binder_release(struct inode *nodp, struct file *filp) > > > > binder_defer_work(proc, BINDER_DEFERRED_RELEASE); > > > > + if (proc->pid == proc->context->report_portid) { > > + proc->context->report_portid = 0; > > + proc->context->report_flags = 0; > > Isn't ->portid the pid from the netlink report manager? How is this ever > going to match a certain proc->pid here? Is this manager supposed to > _also_ open a regular binder fd? > > It seems we are tying the cleanup of the netlink interface to the exit > of the regular binder device, correct? This seems unfortunate as using > the netlink interface should be independent. > > I was playing around with this patch with my own PoC and now I'm stuck: > root@debian:~# ./binder-netlink > ./binder-netlink: nlmsgerr No permission to set flags from 1301: Unknown error -1 > > Is there a different way to reset the protid? > Furthermore, this seems to be a problem when the report manager exits without a binder instance, we still think the report is enabled: [ 202.821346] binder: Failed to send binder netlink message to 597: -111 [ 202.821421] binder: Failed to send binder netlink message to 597: -111 [ 202.821304] binder: Failed to send binder netlink message to 597: -111 [ 202.821306] binder: Failed to send binder netlink message to 597: -111 [ 202.821387] binder: Failed to send binder netlink message to 597: -111 [ 202.821464] binder: Failed to send binder netlink message to 597: -111 [ 202.821467] binder: Failed to send binder netlink message to 597: -111 [ 202.821344] binder: Failed to send binder netlink message to 597: -111 [ 202.822513] binder: Failed to send binder netlink message to 597: -111 [ 202.822152] binder: Failed to send binder netlink message to 597: -111 [ 202.822683] binder: Failed to send binder netlink message to 597: -111 [ 202.822629] binder: Failed to send binder netlink message to 597: -111