• Alistair Popple's avatar
    powerpc: Fix audit crash due to save/restore PPR changes · 05e38e5d
    Alistair Popple authored
    The current mainline crashes when hitting userspace with the following:
    
    kernel BUG at kernel/auditsc.c:1769!
    cpu 0x1: Vector: 700 (Program Check) at [c000000023883a60]
        pc: c0000000001047a8: .__audit_syscall_entry+0x38/0x130
        lr: c00000000000ed64: .do_syscall_trace_enter+0xc4/0x270
        sp: c000000023883ce0
       msr: 8000000000029032
      current = 0xc000000023800000
      paca    = 0xc00000000f080380   softe: 0        irq_happened: 0x01
        pid   = 1629, comm = start_udev
    kernel BUG at kernel/auditsc.c:1769!
    enter ? for help
    [c000000023883d80] c00000000000ed64 .do_syscall_trace_enter+0xc4/0x270
    [c000000023883e30] c000000000009b08 syscall_dotrace+0xc/0x38
     --- Exception: c00 (System Call) at 0000008010ec50dc
    
    Bisecting found the following patch caused it:
    
    commit 44e9309f
    Author: Haren Myneni <haren@linux.vnet.ibm.com>
    powerpc: Implement PPR save/restore
    
    It was found this patch corrupted r9 when calling
    SET_DEFAULT_THREAD_PPR()
    
    Using r10 as a scratch register instead of r9 solved the problem.
    Signed-off-by: default avatarAlistair Popple <alistair@popple.id.au>
    Acked-by: default avatarMichael Neuling <mikey@neuling.org>
    Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
    05e38e5d
entry_64.S 28.5 KB