Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp140021pxf; Wed, 10 Mar 2021 23:35:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxw7jReCAycIdvdNHsPN3tq0gbCDt4JB6iB/Pcs1TP5RsHh/Woo7V9bdy7Z9pz5A5L3tLYF X-Received: by 2002:aa7:dc15:: with SMTP id b21mr7196268edu.350.1615448141299; Wed, 10 Mar 2021 23:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615448141; cv=none; d=google.com; s=arc-20160816; b=0Wui3DIv17LiP600p9z5RDKPa0EjwN/F3HGAnnEu4cBJwcqXzbbLxJuVZljG26FII+ EgSFy8ZlqVJc/6LGsBI0RzyhDUGYhYglPsGXgQ4qfrbM+nmYDPNqhhrG8bWlr/YNnQfc Yc2WDBHIbQxZgbYz7kPvU+2LEVHNdjLPAWgOTbhC7BJpP0H9B+tWHIjwH/AJmJaDHpFP AVaWs7ywHzchZoNZ13EKWi7SeZnnch6jTVH47vlNL4gFHXnUQo/7fpu7JoljTZLIa5Vq uIgqi69Q28bGNoYznWMah1rydtAYBP0E0vxwtkcGwA3ofA3tQ4P0U1UkO5IfLwfo0wB5 F6Iw== 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=CkJOm1xVmRdsGeDzUvMQxiUuAKQ/cZh0Tl+50CZqiyw=; b=cldCgs/Uj+X5oa2qBnuNjF6Enk4rmcLZhsgnmRb14XxHZ2BkmJLqZ97K6FnYv7S6iU w/fWqO3L/tGa7xzMJrgPA0XVYgve3wVBo3w3euH1xqGTUaYtF50dSgRi8JujM2YO0QDE eSvelflUjDKocBMLgjCFuLLqjRm8PuNFNpKu0hH72hZExGNmafq6xf/PBgoLH98RZfWH 92W0eQcqFPSIzngyLF2WD/E9X3v8FB7Z5ah2ci2ZZuiZojgVshHA4fKJpXysg1g+0p9l Jy7y+NrP/uhLsB0ARPhk7tnoufEqYi/6RRj7gx2wlHp6TcMNXR728dC0my+UZ3ucpyBW 0Alg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oQrojNVl; 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 c8si1341095edj.174.2021.03.10.23.35.18; Wed, 10 Mar 2021 23:35:41 -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=oQrojNVl; 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 S231790AbhCKHeP (ORCPT + 99 others); Thu, 11 Mar 2021 02:34:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:55214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbhCKHdq (ORCPT ); Thu, 11 Mar 2021 02:33:46 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05DDA64FA6; Thu, 11 Mar 2021 07:33:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615448025; bh=7dTehs9P2eSp8sPbhZSelcrxKBy+711FsOPQ49ldA2M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oQrojNVlTFN7S2w7V6r70oZ6JR7PULc6szKdgpvs5dN2lZT1ILTgl2y4wcW2Eiw5z T+OoyGSB4CaFAkvbVt9MfHkp/VVSEYzfSsF51gsA4ffmBakBn2BJgewmLidaee8pul j8C3XGKtcv2fvkenUfOl8nPfLi1clTc7ePLBcBaU= Date: Thu, 11 Mar 2021 08:33:42 +0100 From: Greg KH To: Li Li Cc: dualli@google.com, tkjos@google.com, christian@brauner.io, arve@android.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, maco@google.com, hridya@google.com, surenb@google.com, joel@joelfernandes.org, kernel-team@android.com 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: <20210310225251.2577580-2-dualli@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h