1. 01 8月, 2016 10 次提交
  2. 15 6月, 2016 2 次提交
  3. 06 6月, 2016 1 次提交
  4. 26 11月, 2015 1 次提交
    • R
      powerpc: Add rN aliases to the pt_regs_offset table. · 343c3327
      Rashmica Gupta 提交于
      It is common practice with powerpc to use 'rN' to refer to register 'N'. However
      when using the pt_regs_offset table we have to use 'gprN'.
      
      So add aliases such that both 'rN' and 'gprN' can be used.
      
      For example, we can currently do:
        $ su -
        $ cd /sys/kernel/debug/tracing
        $ echo "p:probe/sys_fchownat sys_fchownat %gpr3:s32 +0(%gpr4):string %gpr5:s32 %gpr6:s32 %gpr7:s32" > kprobe_events
        $ echo 1 > events/probe/sys_fchownat/enable
        $ touch /tmp/foo
        $ chown root /tmp/foo
        $ echo 0 > events/enable
        $ cat trace
          chown-2925  [014] d...    76.160657: sys_fchownat: (SyS_fchownat+0x8/0x1a0) arg1=-100 arg2="/tmp/foo" arg3=0 arg4=-1 arg5=0
      
      Instead we'd like to be able to use:
       $ echo "p:probe/sys_fchownat sys_fchownat %r3:s32 +0(%r4):string %r5:s32 %r6:s32 %r7:s32" > kprobe_events
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      343c3327
  5. 30 7月, 2015 1 次提交
    • M
      powerpc/kernel: Enable seccomp filter · 2449acc5
      Michael Ellerman 提交于
      This commit enables seccomp filter on powerpc, now that we have all the
      necessary pieces in place.
      
      To support seccomp's desire to modify the syscall return value under
      some circumstances, we use a different ABI to the ptrace ABI. That is we
      use r3 as the syscall return value, and orig_gpr3 is the first syscall
      parameter.
      
      This means the seccomp code, or a ptracer via SECCOMP_RET_TRACE, will
      see -ENOSYS preloaded in r3. This is identical to the behaviour on x86,
      and allows seccomp or the ptracer to either leave the -ENOSYS or change
      it to something else, as well as rejecting or not the syscall by
      modifying r0.
      
      If seccomp does not reject the syscall, we restore the register state to
      match what ptrace and audit expect, ie. r3 is the first syscall
      parameter again. We do this restore using orig_gpr3, which may have been
      modified by seccomp, which allows seccomp to modify the first syscall
      paramater and allow the syscall to proceed.
      
      We need to #ifdef the the additional handling of r3 for seccomp, so move
      it all out of line.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      2449acc5
  6. 29 7月, 2015 1 次提交
    • M
      powerpc/kernel: Change the do_syscall_trace_enter() API · d3837414
      Michael Ellerman 提交于
      The API for calling do_syscall_trace_enter() is currently sensible
      enough, it just returns the (modified) syscall number.
      
      However once we enable seccomp filter it will get more complicated. When
      seccomp filter runs, the seccomp kernel code (via SECCOMP_RET_ERRNO), or
      a ptracer (via SECCOMP_RET_TRACE), may reject the syscall and *may* or may
      *not* set a return value in r3.
      
      That means the assembler that calls do_syscall_trace_enter() can not
      blindly return ENOSYS, it needs to only return ENOSYS if a return value
      has not already been set.
      
      There is no way to implement that logic with the current API. So change
      the do_syscall_trace_enter() API to make it deal with the return code
      juggling, and the assembler can then just return whatever return code it
      is given.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: NKees Cook <keescook@chromium.org>
      d3837414
  7. 25 9月, 2014 1 次提交
  8. 24 9月, 2014 1 次提交
    • E
      ARCH: AUDIT: audit_syscall_entry() should not require the arch · 91397401
      Eric Paris 提交于
      We have a function where the arch can be queried, syscall_get_arch().
      So rather than have every single piece of arch specific code use and/or
      duplicate syscall_get_arch(), just have the audit code use the
      syscall_get_arch() code.
      Based-on-patch-by: NRichard Briggs <rgb@redhat.com>
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Cc: linux-alpha@vger.kernel.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-ia64@vger.kernel.org
      Cc: microblaze-uclinux@itee.uq.edu.au
      Cc: linux-mips@linux-mips.org
      Cc: linux@lists.openrisc.net
      Cc: linux-parisc@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-sh@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: linux-xtensa@linux-xtensa.org
      Cc: x86@kernel.org
      91397401
  9. 13 12月, 2013 1 次提交
  10. 29 10月, 2013 1 次提交
  11. 19 10月, 2013 2 次提交
  12. 17 10月, 2013 1 次提交
  13. 11 10月, 2013 2 次提交
    • P
      powerpc: Put FP/VSX and VR state into structures · de79f7b9
      Paul Mackerras 提交于
      This creates new 'thread_fp_state' and 'thread_vr_state' structures
      to store FP/VSX state (including FPSCR) and Altivec/VSX state
      (including VSCR), and uses them in the thread_struct.  In the
      thread_fp_state, the FPRs and VSRs are represented as u64 rather
      than double, since we rarely perform floating-point computations
      on the values, and this will enable the structures to be used
      in KVM code as well.  Similarly FPSCR is now a u64 rather than
      a structure of two 32-bit values.
      
      This takes the offsets out of the macros such as SAVE_32FPRS,
      REST_32FPRS, etc.  This enables the same macros to be used for normal
      and transactional state, enabling us to delete the transactional
      versions of the macros.   This also removes the unused do_load_up_fpu
      and do_load_up_altivec, which were in fact buggy since they didn't
      create large enough stack frames to account for the fact that
      load_up_fpu and load_up_altivec are not designed to be called from C
      and assume that their caller's stack frame is an interrupt frame.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      de79f7b9
    • A
      powerpc: PTRACE_PEEKUSR/PTRACE_POKEUSER of FPR registers in little endian builds · 87fec051
      Anton Blanchard 提交于
      FPRs overlap the high 64bits of the first 32 VSX registers. The
      ptrace FP read/write code assumes big endian ordering and grabs
      the lowest 64 bits.
      
      Fix this by using the TS_FPR macro which does the right thing.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      87fec051
  14. 10 7月, 2013 1 次提交
  15. 25 6月, 2013 1 次提交
  16. 14 5月, 2013 1 次提交
  17. 18 4月, 2013 2 次提交
  18. 17 3月, 2013 1 次提交
  19. 16 1月, 2013 1 次提交
    • A
      powerpc: Add DSCR support to ptrace · 1715a826
      Alexey Kardashevskiy 提交于
      The DSCR (aka Data Stream Control Register) is supported on some
      server PowerPC chips and allow some control over the prefetch
      of data streams.
      
      The kernel already supports DSCR value per thread but there is also
      a need in a ability to change it from an external process for
      the specific pid.
      
      The patch adds new register index PT_DSCR (index=44) which can be
      set/get by:
        ptrace(PTRACE_POKEUSER, traced_process, PT_DSCR << 3, dscr);
        dscr = ptrace(PTRACE_PEEKUSER, traced_process, PT_DSCR << 3, NULL);
      
      The patch does not increase PT_REGS_COUNT as the pt_regs struct has not
      been changed.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      1715a826
  20. 10 1月, 2013 1 次提交
  21. 15 11月, 2012 4 次提交
  22. 10 9月, 2012 1 次提交
  23. 22 5月, 2012 1 次提交
  24. 14 5月, 2012 1 次提交