Re: [PATCH v2] binder: fix atomic sleep when get extended error

From: Carlos Llamas
Date: Tue May 17 2022 - 21:27:22 EST


On Wed, May 18, 2022 at 09:17:54AM +0800, Schspa Shi wrote:
> binder_inner_proc_lock(thread->proc) is a spin lock, copy_to_user can't
> be called with in this lock.
>
> Copy it as a local variable to fix it.
>
> Reported-by: syzbot+46fff6434a7f968ecb39@xxxxxxxxxxxxxxxxxxxxxxxxx
> Fixes: bd32889e841c ("binder: add BINDER_GET_EXTENDED_ERROR ioctl")
> Signed-off-by: Schspa Shi <schspa@xxxxxxxxx>
>
> ---
>
> Changelog:
> v1 -> v2:
> - Remove the retry as Carlos Llamas adviced.
> - Use binder_set_extended_error to reset the error info.
> ---

LGTM, thanks.

Reviewed-by: Carlos Llamas <cmllamas@xxxxxxxxxx>

--
Carlos Llamas