Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2863571pxb; Mon, 18 Oct 2021 03:36:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylW01yy15Zd+Rhs0wy3oOyR0PAFzb9Qh3yNFPFHvDb50n72kwznji6ntavbA2DhUct3DPT X-Received: by 2002:a17:90a:17e1:: with SMTP id q88mr32163776pja.99.1634553416457; Mon, 18 Oct 2021 03:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634553416; cv=none; d=google.com; s=arc-20160816; b=nFjYmsCeQNKSt6Z5nYihe3jkI5KAHvQv4HXVcvaFLlEPlWSrw2lFMkFu8CEHHUGP43 nj4ilk9eJBfPODFKTuEsa/lngb4lwHfJck+5T90J1ETjUP3FATid+L1GPcxFFnF8lHMa SaV64Ry4kiw4+6MV+iEXI+zgZXNP+YZkiPL/BJw5+cPD956/sBQQ+aePw2/ui6/L+QeR otKdIMt5nU4V5iiFo40ce9aBIpqhyRpEPXgPPa6nnRRWdnRfk7cWn4i6n43k17L2bqBT 798RWiXz3K50vkHKTBHKwTckKsA4DSIQT7zVFtINmFevkWPcJUDtjHP1N/8slKViir3P h18g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=k7mddXc6RsWPb97tHSIYfhkkQfqiLGSrENuoq12c41g=; b=OWiFhLOO9lr1Z6Qh6UHT6PGR1wFS4Tw5DO5XxCQtp2ppNl2EqTtOFuRn6jmhKUIYo/ BZAzAFwXgf/zQdyhW8RcgnxpC6KDaboAulND74fWg0UIedKT37F4kNv9hEhlX1j99EoQ JOV6QNpKmshhCqSmxcrkVnCuznAAzhGYYpi9HxkgAZ//8jPAqNIAV6Ow64sd6g2CDukI PJ1zbmXfbH8fYFfKroczb/MbGQqSdZck7mgJgJSqpSaBap4uT/UbZyZjaWdKRBqpaAFf TpNMLYDHeKNlMs2DLN8ihyZ60Duh9wCTqraDr5d+cSkd1DT8VR84FnDQGn26lcSrJeua YO4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si483299pfc.213.2021.10.18.03.36.44; Mon, 18 Oct 2021 03:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229998AbhJRKhk (ORCPT + 99 others); Mon, 18 Oct 2021 06:37:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:36410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbhJRKhj (ORCPT ); Mon, 18 Oct 2021 06:37:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 33C6B6103B; Mon, 18 Oct 2021 10:35:26 +0000 (UTC) Date: Mon, 18 Oct 2021 12:35:23 +0200 From: Christian Brauner To: Todd Kjos Cc: gregkh@linuxfoundation.org, christian@brauner.io, arve@android.com, jannh@google.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, maco@google.com, joel@joelfernandes.org, kernel-team@android.com Subject: Re: [PATCH] binder: don't detect sender/target during buffer cleanup Message-ID: <20211018103523.dn5rnrefulhd2gzc@wittgenstein> References: <20211015233811.3532235-1-tkjos@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211015233811.3532235-1-tkjos@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 15, 2021 at 04:38:11PM -0700, Todd Kjos wrote: > When freeing txn buffers, binder_transaction_buffer_release() > attempts to detect whether the current context is the target by > comparing current->group_leader to proc->tsk. This is an unreliable > test. Instead explicitly pass an 'is_failure' boolean. > > Detecting the sender was being used as a way to tell if the > transaction failed to be sent. When cleaning up after > failing to send a transaction, there is no need to close > the fds associated with a BINDER_TYPE_FDA object. Now > 'is_failure' can be used to accurately detect this case. > > Fixes: 44d8047f1d87 ("binder: use standard functions to allocate fds") > Signed-off-by: Todd Kjos > --- Looks good to me. Acked-by: Christian Brauner