Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp207388pxf; Thu, 11 Mar 2021 01:46:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpLWzsaGjuqSYGCkxc6vCGbdCYOH4bHnOcxKtsVWO/ll/iHDtmkO27BLKOgurmhcnjCrsa X-Received: by 2002:a17:907:f97:: with SMTP id kb23mr2201770ejc.33.1615455981767; Thu, 11 Mar 2021 01:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615455981; cv=none; d=google.com; s=arc-20160816; b=ariwTWRA9m1DNtIbI7NWdHOhINvyIVpA0JdARhbLtMDzrJCGgGzkT75TfBViRgxPUW 7ygWNIPq9ZwCnMrJXvETCLR/xsTkWWqP9q3CRoIfVuiPaG0skaBulqZUT9L5XZ4WLGhb 1Pc3JqMO5IKatQOlNxA8bOp4Q29x5xlwAXoAzVkgsSNdYT9w+X60HPSMf/qp1Uag8NwM 0TbjGapgwGRkdQQExJGl/T7gjeBmMBN4geh98yzBa8bWOiIb+LGaZAPqfHDV1ojK9MJl KqkktiBiGZ7sivs3da3EzrdJF5yXWtRhW3Zni1yEhp0D43Qnk85hnqYhrpa1pCr9jVhR LrOQ== 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:dkim-signature; bh=QTKQZwVh9J2ViiZbQ7KQ5+Opdcw6YPWHhC5LeEbgSnc=; b=K95jWjG2ohv68ihrb2Lo2ffvlHXfpEzQzGg8lTf9H5PGKX75LRGc40CR7Q0jbF4cVq y1snC/vCNWM5CFTodOgV8yNrUIV4EnYqbsA7Bl44JxY+BbnogIL9l5yFZZTDYRCu/BZl P8KEQoKJFsMgGePuPvFHi2pdYEgoIm6OTKZP+byBeUMlTwpv4+ZGWhl9rZk4FDu67rXf gsOyyntVKL08p+CLnr3muOxMd3XCu31ciySOyZ6ABoeFjevnW4E/kotucP9YDTRzXX7z 7Nkxq235bddxZW9GZ3LkQae7vqdPedqucrU61J1VgiZL364NIxMQrB9llKdnE/KnioeA 1mGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WkmM9L6l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r18si1534175edi.229.2021.03.11.01.45.59; Thu, 11 Mar 2021 01:46:21 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WkmM9L6l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232086AbhCKJoy (ORCPT + 99 others); Thu, 11 Mar 2021 04:44:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:53056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbhCKJob (ORCPT ); Thu, 11 Mar 2021 04:44:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDE4164F4D; Thu, 11 Mar 2021 09:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615455871; bh=SaEIjM8sp4BLwWqGdZsQ+udzNVG7cu3QRpUq15na99g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WkmM9L6l20aZWALR1j9F37d1oS1MH2iZnRT5Uufp9E4ugDu2LFp/7lOmJv0XlFuDO naPtrvYUoj4H3Rj5Y65s5Y6En5e+P+KnkKUVqiwNDkz23h5qpYs/n0Him0ZmWQonjE JZPDRq34COMnNuM+Od7+Ss9+1XcTm4FebnBcq35E= Date: Thu, 11 Mar 2021 10:44:28 +0100 From: Greg KH To: Li Li Cc: devel@driverdev.osuosl.org, kernel-team@android.com, linux-kernel@vger.kernel.org, joel@joelfernandes.org, arve@android.com, Martijn Coenen , hridya@google.com, surenb@google.com, christian@brauner.io, Todd Kjos Subject: Re: [PATCH v1 1/3] binder: BINDER_FREEZE ioctl Message-ID: References: <20210310225251.2577580-1-dualli@chromium.org> <20210310225251.2577580-2-dualli@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 01:36:26AM -0800, Li Li wrote: > On Wed, Mar 10, 2021 at 11:33 PM Greg KH wrote: > > > > On Wed, Mar 10, 2021 at 02:52:49PM -0800, Li Li wrote: > > > if (target_proc) { > > > binder_inner_proc_lock(target_proc); > > > + target_proc->outstanding_txns--; > > > + WARN_ON(target_proc->outstanding_txns < 0); > > > > WARN_* is a huge crutch, please just handle stuff like this properly and > > if you really need to, warn userspace (but what can they do about it?) > > > > You also just rebooted all systems that have panic-on-warn set, so if > > this can be triggered by userspace, you caused a DoS of things :( > > > > So please remove all of the WARN_ON() you add in this patch series to > > properly handle the error conditions and deal with them correctly. > > > > And if these were here just for debugging, hopefully the code works > > properly now and you do not need debugging anymore so they can all just > > be dropped. > > When the target_proc is freed, there's no outstanding transactions already. > The FREEZE ioctl from userspace won't trigger this. It's for debugging. It's ok to test for this, to verify all is good, just do not reboot people's machines if the test fails :) thanks, greg k-h