All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: stable@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>,
	Todd Kjos <tkjos@android.com>, Eric Biggers <ebiggers@google.com>
Subject: Re: [PATCH 4.4,4.9] binder: add missing binder_unlock()
Date: Mon, 26 Feb 2018 20:37:09 +0100	[thread overview]
Message-ID: <20180226193709.GC21453@kroah.com> (raw)
In-Reply-To: <20180226185645.241652-1-ebiggers3@gmail.com>

On Mon, Feb 26, 2018 at 10:56:45AM -0800, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
> 
> [Please apply to 4.4-stable and 4.9-stable.]
> 
> When commit 4be5a2810489 ("binder: check for binder_thread allocation
> failure in binder_poll()") was applied to 4.4-stable and 4.9-stable it
> was forgotten to release the global binder lock in the new error path.
> The global binder lock wasn't removed until v4.14, by commit
> a60b890f607d ("binder: remove global binder lock").
> 
> Fix the new error path to release the lock.
> 
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  drivers/android/binder.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 3b6ac80b2127..49199bd2ab93 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -2628,8 +2628,10 @@ static unsigned int binder_poll(struct file *filp,
>  	binder_lock(__func__);
>  
>  	thread = binder_get_thread(proc);
> -	if (!thread)
> +	if (!thread) {
> +		binder_unlock(__func__);
>  		return POLLERR;
> +	}
>  
>  	wait_for_proc_work = thread->transaction_stack == NULL &&
>  		list_empty(&thread->todo) && thread->return_error == BR_OK;
> -- 
> 2.16.1.291.g4437f3f132-goog

Thanks for the patch, all now queued up.

greg k-h

  parent reply	other threads:[~2018-02-26 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 18:56 [PATCH 4.4,4.9] binder: add missing binder_unlock() Eric Biggers
2018-02-26 19:04 ` Todd Kjos
2018-02-26 19:36 ` Patch "binder: add missing binder_unlock()" has been added to the 4.4-stable tree gregkh
2018-02-26 19:37 ` Greg Kroah-Hartman [this message]
2018-02-26 19:37 ` Patch "binder: add missing binder_unlock()" has been added to the 4.9-stable tree gregkh

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=20180226193709.GC21453@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=ebiggers3@gmail.com \
    --cc=ebiggers@google.com \
    --cc=linux@roeck-us.net \
    --cc=stable@vger.kernel.org \
    --cc=tkjos@android.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.