lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHRSSEwjH=GyxR7E0WhpDb9so_Lc=3-M=2-zmYhptViX5=ZSTg@mail.gmail.com>
Date:   Wed, 09 May 2018 18:08:36 +0000
From:   Todd Kjos <tkjos@...gle.com>
To:     宋金时 <songjinshi@...omi.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Martijn Coenen <maco@...roid.com>,
        Arve Hjønnevåg <arve@...roid.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR

On Wed, May 9, 2018 at 12:31 AM 宋金时 <songjinshi@...omi.com> wrote:

> In case of the BINDER_WORK_RETURN_ERROR the cmd is no assignment,
> so it's value will be old value or dirty value, before modifying
> e->cmd, assign the value of the e->cmd to cmd to ensure the correct
> print of binder_stat_br.


That's not the problem... the problem is that e->cmd is unconditionally set
to BR_OK prior to the call to binder_stat_br(proc, thread, e->cmd) so the
reported cmd is always BR_OK.


> Signed-off-by: songjinshi <songjinshi@...omi.com>
> ---

> diff --git a/drivers/android/binder.c b/drivers/android/binder.c
> index 4ffc84d..acd7d44a 100644
> --- a/drivers/android/binder.c
> +++ b/drivers/android/binder.c
> @@ -4086,6 +4086,7 @@
>                          struct binder_error *e = container_of(
>                                          w, struct binder_error, work);

> +                       cmd = e->cmd;
>                          WARN_ON(e->cmd == BR_OK);
>                          binder_inner_proc_unlock(proc);
>                          if (put_user(e->cmd, (uint32_t __user *)ptr))


Don't you also need to use cmd in the call to binder_state_br() below?

-                       binder_stat_br(proc, thread, e->cmd);
+                       binder_stat_br(proc, thread, cmd);

-Todd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ