lkml.org 
[lkml]   [2013]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 001/103] powerpc/hw_brk: Fix setting of length for exact mode breakpoints
    Date
    3.10-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Michael Neuling <mikey@neuling.org>

    commit b0b0aa9c7faf94e92320eabd8a1786c7747e40a8 upstream.

    The smallest match region for both the DABR and DAWR is 8 bytes, so the
    kernel needs to filter matches when users want to look at regions smaller than
    this.

    Currently we set the length of PPC_BREAKPOINT_MODE_EXACT breakpoints to 8.
    This is wrong as in exact mode we should only match on 1 address, hence the
    length should be 1.

    This ensures that the kernel will filter out any exact mode hardware breakpoint
    matches on any addresses other than the requested one.

    Signed-off-by: Michael Neuling <mikey@neuling.org>
    Reported-by: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/powerpc/kernel/ptrace.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/arch/powerpc/kernel/ptrace.c
    +++ b/arch/powerpc/kernel/ptrace.c
    @@ -1449,7 +1449,9 @@ static long ppc_set_hwdebug(struct task_
    */
    if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) {
    len = bp_info->addr2 - bp_info->addr;
    - } else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) {
    + } else if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT)
    + len = 1;
    + else {
    ptrace_put_breakpoints(child);
    return -EINVAL;
    }



    \
     
     \ /
      Last update: 2013-07-24 04:21    [W:3.037 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site