1. 10 12月, 2008 8 次提交
    • R
      tracehook: exec double-reporting fix · 85f33466
      Roland McGrath 提交于
      The patch 6341c393 "tracehook: exec" introduced a small regression in
      2.6.27 regarding binfmt_misc exec event reporting.  Since the reporting
      is now done in the common search_binary_handler() function, an exec
      of a misc binary will result in two (or possibly multiple) exec events
      being reported, instead of just a single one, because the misc handler
      contains a recursive call to search_binary_handler.
      
      To add to the confusion, if PTRACE_O_TRACEEXEC is not active, the multiple
      SIGTRAP signals will in fact cause only a single ptrace intercept, as the
      signals are not queued.  However, if PTRACE_O_TRACEEXEC is on, the debugger
      will actually see multiple ptrace intercepts (PTRACE_EVENT_EXEC).
      
      The test program included below demonstrates the problem.
      
      This change fixes the bug by calling tracehook_report_exec() only in the
      outermost search_binary_handler() call (bprm->recursion_depth == 0).
      
      The additional change to restore bprm->recursion_depth after each binfmt
      load_binary call is actually superfluous for this bug, since we test the
      value saved on entry to search_binary_handler().  But it keeps the use of
      of the depth count to its most obvious expected meaning.  Depending on what
      binfmt handlers do in certain cases, there could have been false-positive
      tests for recursion limits before this change.
      
          /* Test program using PTRACE_O_TRACEEXEC.
             This forks and exec's the first argument with the rest of the arguments,
             while ptrace'ing.  It expects to see one PTRACE_EVENT_EXEC stop and
             then a successful exit, with no other signals or events in between.
      
             Test for kernel doing two PTRACE_EVENT_EXEC stops for a binfmt_misc exec:
      
             $ gcc -g traceexec.c -o traceexec
             $ sudo sh -c 'echo :test:M::foobar::/bin/cat: > /proc/sys/fs/binfmt_misc/register'
             $ echo 'foobar test' > ./foobar
             $ chmod +x ./foobar
             $ ./traceexec ./foobar; echo $?
             ==> good <==
             foobar test
             0
             $
             ==> bad <==
             foobar test
             unexpected status 0x4057f != 0
             3
             $
      
          */
      
          #include <stdio.h>
          #include <sys/types.h>
          #include <sys/wait.h>
          #include <sys/ptrace.h>
          #include <unistd.h>
          #include <signal.h>
          #include <stdlib.h>
      
          static void
          wait_for (pid_t child, int expect)
          {
            int status;
            pid_t p = wait (&status);
            if (p != child)
      	{
      	  perror ("wait");
      	  exit (2);
      	}
            if (status != expect)
      	{
      	  fprintf (stderr, "unexpected status %#x != %#x\n", status, expect);
      	  exit (3);
      	}
          }
      
          int
          main (int argc, char **argv)
          {
            pid_t child = fork ();
      
            if (child < 0)
      	{
      	  perror ("fork");
      	  return 127;
      	}
            else if (child == 0)
      	{
      	  ptrace (PTRACE_TRACEME);
      	  raise (SIGUSR1);
      	  execv (argv[1], &argv[1]);
      	  perror ("execve");
      	  _exit (127);
      	}
      
            wait_for (child, W_STOPCODE (SIGUSR1));
      
            if (ptrace (PTRACE_SETOPTIONS, child,
      		  0L, (void *) (long) PTRACE_O_TRACEEXEC) != 0)
      	{
      	  perror ("PTRACE_SETOPTIONS");
      	  return 4;
      	}
      
            if (ptrace (PTRACE_CONT, child, 0L, 0L) != 0)
      	{
      	  perror ("PTRACE_CONT");
      	  return 5;
      	}
      
            wait_for (child, W_STOPCODE (SIGTRAP | (PTRACE_EVENT_EXEC << 8)));
      
            if (ptrace (PTRACE_CONT, child, 0L, 0L) != 0)
      	{
      	  perror ("PTRACE_CONT");
      	  return 6;
      	}
      
            wait_for (child, W_EXITCODE (0, 0));
      
            return 0;
          }
      Reported-by: NArnd Bergmann <arnd@arndb.de>
      CC: Ulrich Weigand <ulrich.weigand@de.ibm.com>
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      85f33466
    • L
      Merge master.kernel.org:/home/rmk/linux-2.6-arm · 437f2f91
      Linus Torvalds 提交于
      * master.kernel.org:/home/rmk/linux-2.6-arm:
        [ARM] Fix alignment fault handling for ARMv6 and later CPUs
        [ARM] 5340/1: fix stack placement after noexecstack changes
        [ARM] 5339/1: fix __fls() on ARM
        [ARM] Orion: fix bug in pcie configuration cycle function field mask
        [ARM] omap: fix a pile of issues
      437f2f91
    • L
      Merge git://git.infradead.org/mtd-2.6 · 4d9c6a21
      Linus Torvalds 提交于
      * git://git.infradead.org/mtd-2.6:
        [MTD] [NAND] fix OOPS accessing flash operations over STM flash on PXA
        [MTD] [NAND] drivers/mtd/nand/pasemi_nand.c: Add missing pci_dev_put
        [MTD] [NAND] fsl_upm: fix build problem with 2.6.28-rc2
        [MTD] physmap: fix memory leak on physmap_flash_remove by using devres
        [MTD] m25p80: chip erase != block erase != sector erase
        [MTD] m25p80: fix detection of m25p16 flashes
        [MTD] m25p80: fix detection of SPI parts
        [MTD] [NAND] OMAP: OneNAND: header file relocation (part 2)
        [MTD] [NAND] OMAP: OneNAND: header file relocation
      4d9c6a21
    • L
      Merge branch 'audit.b59' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current · b749e3f8
      Linus Torvalds 提交于
      * 'audit.b59' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit-current:
        [PATCH] fix broken timestamps in AVC generated by kernel threads
        [patch 1/1] audit: remove excess kernel-doc
        [PATCH] asm/generic: fix bug - kernel fails to build when enable some common audit code on Blackfin
        [PATCH] return records for fork() both to child and parent
        [PATCH] Audit: make audit=0 actually turn off audit
      b749e3f8
    • L
      Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev · 6f8e5850
      Linus Torvalds 提交于
      * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        ata: Fix experimental tags
        pata_ninja32: update ID table
        pata_sis: Remove bogus cable match
        ATA: piix, fix pointer deref on suspend
        pata_hpt366: fix clock detection
      6f8e5850
    • L
      Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 · 21283f05
      Linus Torvalds 提交于
      * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm/i915: Disable the GM965 MSI errata workaround.
        drm/i915: Don't return error in evict_everything when we get to the end.
        drm/radeon: don't actually enable the IRQ regs until irq is enabled
      21283f05
    • L
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc · cdf0c7de
      Linus Torvalds 提交于
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
        powerpc/virtex5: Fix Virtex5 machine check handling
      cdf0c7de
    • B
      radeonfb: Disable new color expand acceleration unless explicitely enabled · f3179748
      Benjamin Herrenschmidt 提交于
      This new color expansion acceleration for radeonfb appears to trigger
      problems with X on VT switch and suspend/resume on some machines. It
      might be a problem in the VT layer or in X, but I haven't quite found
      it yet, so in the meantime, this disables the acceleration by default,
      reverting to 2.6.27 state. It can be enabled using the "accel_cexp"
      module parameter or fbdev argument.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f3179748
  2. 09 12月, 2008 20 次提交
  3. 08 12月, 2008 7 次提交
  4. 07 12月, 2008 1 次提交
  5. 06 12月, 2008 4 次提交