linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Li <dualli@chromium.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Todd Kjos <tkjos@google.com>,
	christian@brauner.io, arve@android.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	Martijn Coenen <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
Date: Thu, 11 Mar 2021 01:36:26 -0800	[thread overview]
Message-ID: <CA+xfxX4tD30BJLgwLAoiMzF7xTC-4q1i0A5Znp3tJzyi3ATLzQ@mail.gmail.com> (raw)
In-Reply-To: <YEnH1qd527g/neY4@kroah.com>

On Wed, Mar 10, 2021 at 11:33 PM Greg KH <gregkh@linuxfoundation.org> 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.
And I'll remove it in v2. Thanks for the suggestion!

  reply	other threads:[~2021-03-11  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 22:52 [PATCH v1 0/3] Binder: Enable App Freezing Capability Li Li
2021-03-10 22:52 ` [PATCH v1 1/3] binder: BINDER_FREEZE ioctl Li Li
2021-03-11  7:33   ` Greg KH
2021-03-11  9:36     ` Li Li [this message]
2021-03-11  9:44       ` Greg KH
2021-03-10 22:52 ` [PATCH v1 2/3] binder: use EINTR for interrupted wait for work Li Li
2021-03-10 22:52 ` [PATCH v1 3/3] binder: BINDER_GET_FROZEN_INFO ioctl Li Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+xfxX4tD30BJLgwLAoiMzF7xTC-4q1i0A5Znp3tJzyi3ATLzQ@mail.gmail.com \
    --to=dualli@chromium.org \
    --cc=arve@android.com \
    --cc=christian@brauner.io \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hridya@google.com \
    --cc=joel@joelfernandes.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@google.com \
    --cc=surenb@google.com \
    --cc=tkjos@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).