1. 02 8月, 2012 1 次提交
  2. 18 1月, 2012 2 次提交
    • E
      audit: inline audit_syscall_entry to reduce burden on archs · b05d8447
      Eric Paris 提交于
      Every arch calls:
      
      if (unlikely(current->audit_context))
      	audit_syscall_entry()
      
      which requires knowledge about audit (the existance of audit_context) in
      the arch code.  Just do it all in static inline in audit.h so that arch's
      can remain blissfully ignorant.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      b05d8447
    • E
      Audit: push audit success and retcode into arch ptrace.h · d7e7528b
      Eric Paris 提交于
      The audit system previously expected arches calling to audit_syscall_exit to
      supply as arguments if the syscall was a success and what the return code was.
      Audit also provides a helper AUDITSC_RESULT which was supposed to simplify things
      by converting from negative retcodes to an audit internal magic value stating
      success or failure.  This helper was wrong and could indicate that a valid
      pointer returned to userspace was a failed syscall.  The fix is to fix the
      layering foolishness.  We now pass audit_syscall_exit a struct pt_reg and it
      in turns calls back into arch code to collect the return value and to
      determine if the syscall was a success or failure.  We also define a generic
      is_syscall_success() macro which determines success/failure based on if the
      value is < -MAX_ERRNO.  This works for arches like x86 which do not use a
      separate mechanism to indicate syscall failure.
      
      We make both the is_syscall_success() and regs_return_value() static inlines
      instead of macros.  The reason is because the audit function must take a void*
      for the regs.  (uml calls theirs struct uml_pt_regs instead of just struct
      pt_regs so audit_syscall_exit can't take a struct pt_regs).  Since the audit
      function takes a void* we need to use static inlines to cast it back to the
      arch correct structure to dereference it.
      
      The other major change is that on some arches, like ia64, MIPS and ppc, we
      change regs_return_value() to give us the negative value on syscall failure.
      THE only other user of this macro, kretprobe_example.c, won't notice and it
      makes the value signed consistently for the audit functions across all archs.
      
      In arch/sh/kernel/ptrace_64.c I see that we were using regs[9] in the old
      audit code as the return value.  But the ptrace_64.h code defined the macro
      regs_return_value() as regs[3].  I have no idea which one is correct, but this
      patch now uses the regs_return_value() function, so it now uses regs[3].
      
      For powerpc we previously used regs->result but now use the
      regs_return_value() function which uses regs->gprs[3].  regs->gprs[3] is
      always positive so the regs_return_value(), much like ia64 makes it negative
      before calling the audit code when appropriate.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: H. Peter Anvin <hpa@zytor.com> [for x86 portion]
      Acked-by: Tony Luck <tony.luck@intel.com> [for ia64]
      Acked-by: Richard Weinberger <richard@nod.at> [for uml]
      Acked-by: David S. Miller <davem@davemloft.net> [for sparc]
      Acked-by: Ralf Baechle <ralf@linux-mips.org> [for mips]
      Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [for ppc]
      d7e7528b
  3. 15 9月, 2011 1 次提交
  4. 12 11月, 2010 1 次提交
  5. 28 10月, 2010 2 次提交
  6. 10 8月, 2010 1 次提交
  7. 13 3月, 2010 1 次提交
    • C
      um: use generic ptrace_resume code · 1bd09508
      Christoph Hellwig 提交于
      Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT,
      PTRACE_KILL and PTRACE_SINGLESTEP.  This implies defining
      arch_has_single_step in <asm/ptrace.h> and implementing the
      user_enable_single_step and user_disable_single_step functions, which also
      causes the breakpoint information to be cleared on fork, which could be
      considered a bug fix.
      
      Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which
      it previously wasn't which is consistent with all architectures using the
      modern ptrace code.
      
      XXX: I'm not sure arch_has_single_step() is placed in the exactly correct
      location, please verify in which of the ptrace headers it should really
      be.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1bd09508
  8. 13 3月, 2009 1 次提交
    • R
      UML on UML fixed: it did not start · 86d6f2bf
      Renzo Davoli 提交于
      It is currently impossible to run a user-mode linux machine inside another
      user-mode linux (UML on UML).  It breaks after a few instructions.  When
      it tries to check whether SYSEMU is installed (the inner) UML receives an
      inconsistent result (from the outer UML).
      
      This is the output of a broken attempt:
      $ ./linux mem=256m ubd0=cow
      Locating the bottom of the address space ... 0x0
      Locating the top of the address space ... 0xc0000000
      Core dump limits :
              soft - 0
              hard - NONE
      Checking that ptrace can change system call numbers...OK
      Checking ptrace new tags for syscall emulation...unsupported
      Checking syscall emulation patch for ptrace...check_sysemu : expected SIGTRAP, got status = 256
      $
      
      The problem is the following:
      
      PTRACE_SYSCALL/SINGLESTEP is currently managed inside arch_ptrace for ARCH=um.
      
      PTRACE_SYSEMU/SUSEMU_SINGLESTEP is not captured in arch_ptrace's switch,
      therefore it is erroneously passed back to ptrace_request (in
      kernel/ptrace).
      
      This simple patch simply forces ptrace to return an error on
      PTRACE_SYSEMU/SUSEMU_SINGLESTEP as it is unsupported on ARCH=um, and fixes
      the problem.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NRenzo Davoli <renzo@cs.unibo.it>
      Reviewed-by: NWANG Cong <xiyou.wangcong@gmail.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      86d6f2bf
  9. 25 7月, 2008 1 次提交
  10. 20 10月, 2007 1 次提交
  11. 17 10月, 2007 5 次提交
  12. 18 7月, 2007 2 次提交
  13. 12 2月, 2007 1 次提交
  14. 01 5月, 2006 1 次提交
  15. 01 4月, 2006 2 次提交
  16. 07 11月, 2005 1 次提交
  17. 29 5月, 2005 1 次提交
  18. 21 5月, 2005 1 次提交
    • J
      [PATCH] uml: small fixes left over from rc4 · ba9950c8
      Jeff Dike 提交于
      Some changes that I sent in didn't make 2.6.12-rc4 for some reason.  This
      adds them back.  We have
      	an x86_64 definition of TOP_ADDR
      	a reimplementation of the x86_64 csum_partial_copy_from_user
      	some syntax fixes in arch/um/kernel/ptrace.c
      	removal of a CFLAGS definition in the x86_64 Makefile
      	some include changes in the x86_64 ptrace.c and user-offsets.h
      	a syntax fix in elf-x86_64.h
      Also moved an include in the i386 and x86_64 Makefiles to make the symlinks
      work, and some small fixes from Al Viro.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: <viro@parcelfarce.linux.theplanet.co.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ba9950c8
  19. 07 5月, 2005 1 次提交
  20. 06 5月, 2005 3 次提交
  21. 03 5月, 2005 1 次提交
  22. 01 5月, 2005 1 次提交
  23. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4