1. 30 3月, 2012 3 次提交
    • J
      kgdbts: (1 of 2) fix single step awareness to work correctly with SMP · 486c5987
      Jason Wessel 提交于
      The do_fork and sys_open tests have never worked properly on anything
      other than a UP configuration with the kgdb test suite.  This is
      because the test suite did not fully implement the behavior of a real
      debugger.  A real debugger tracks the state of what thread it asked to
      single step and can correctly continue other threads of execution or
      conditionally stop while waiting for the original thread single step
      request to return.
      
      Below is a simple method to cause a fatal kernel oops with the kgdb
      test suite on a 4 processor x86 system:
      
      while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
      while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
      while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
      while [ 1 ] ; do ls > /dev/null 2> /dev/null; done&
      echo V1I1F1000 > /sys/module/kgdbts/parameters/kgdbts
      
      Very soon after starting the test the kernel will oops with a message like:
      
      kgdbts: BP mismatch 3b7da66480 expected ffffffff8106a590
      WARNING: at drivers/misc/kgdbts.c:303 check_and_rewind_pc+0xe0/0x100()
      Call Trace:
       [<ffffffff812994a0>] check_and_rewind_pc+0xe0/0x100
       [<ffffffff81298945>] validate_simple_test+0x25/0xc0
       [<ffffffff81298f77>] run_simple_test+0x107/0x2c0
       [<ffffffff81298a18>] kgdbts_put_char+0x18/0x20
      
      The warn will turn to a hard kernel crash shortly after that because
      the pc will not get properly rewound to the right value after hitting
      a breakpoint leading to a hard lockup.
      
      This change is broken up into 2 pieces because archs that have hw
      single stepping (2.6.26 and up) need different changes than archs that
      do not have hw single stepping (3.0 and up).  This change implements
      the correct behavior for an arch that supports hw single stepping.
      
      A minor defect was fixed where sys_open should be do_sys_open
      for the sys_open break point test.  This solves the problem of running
      a 64 bit with a 32 bit user space.  The sys_open() never gets called
      when using the 32 bit file system for the kgdb testsuite because the
      32 bit binaries invoke the compat_sys_open() call leading to the test
      never completing.
      
      In order to mimic a real debugger, the kgdb test suite now tracks the
      most recent thread that was continued (cont_thread_id), with the
      intent to single step just this thread.  When the response to the
      single step request stops in a different thread that hit the original
      break point that thread will now get continued, while the debugger
      waits for the thread with the single step pending.  Here is a high
      level description of the sequence of events.
      
         cont_instead_of_sstep = 0;
      
      1) set breakpoint at do_fork
      2) continue
      3)   Save the thread id where we stop to cont_thread_id
      4) Remove breakpoint at do_fork
      5) Reset the PC if needed depending on kernel exception type
      6) if (cont_instead_of_sstep) { continue } else { single step }
      7)   Check where we stopped
             if current thread != cont_thread_id {
                 cont_instead_of_sstep = 1;
                 goto step 5
             } else {
                 cont_instead_of_sstep = 0;
             }
      8) clean up and run test again if needed
      
      Cc: stable@vger.kernel.org # >= 2.6.26
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      486c5987
    • J
      kgdbts: Fix kernel oops with CONFIG_DEBUG_RODATA · 456ca7ff
      Jason Wessel 提交于
      On x86 the kgdb test suite will oops when the kernel is compiled with
      CONFIG_DEBUG_RODATA and you run the tests after boot time. This is
      regression has existed since 2.6.26 by commit: b33cb815 (kgdbts: Use
      HW breakpoints with CONFIG_DEBUG_RODATA).
      
      The test suite can use hw breakpoints for all the tests, but it has to
      execute the hardware breakpoint specific tests first in order to
      determine that the hw breakpoints actually work.  Specifically the
      very first test causes an oops:
      
      # echo V1I1 > /sys/module/kgdbts/parameters/kgdbts
      kgdb: Registered I/O driver kgdbts.
      kgdbts:RUN plant and detach test
      
      Entering kdb (current=0xffff880017aa9320, pid 1078) on processor 0 due to Keyboard Entry
      [0]kdb> kgdbts: ERROR PUT: end of test buffer on 'plant_and_detach_test' line 1 expected OK got $E14#aa
      WARNING: at drivers/misc/kgdbts.c:730 run_simple_test+0x151/0x2c0()
      [...oops clipped...]
      
      This commit re-orders the running of the tests and puts the RODATA
      check into its own function so as to correctly avoid the kernel oops
      by detecting and using the hw breakpoints.
      
      Cc: <stable@vger.kernel.org> # >= 2.6.26
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      456ca7ff
    • J
      kdb: Fix smatch warning on dbg_io_ops->is_console · 78724b8e
      Jason Wessel 提交于
      The Smatch tool warned that the change from commit b8adde8d
      (kdb: Avoid using dbg_io_ops until it is initialized) should
      add another null check later in the kdb_printf().
      
      It is worth noting that the second use of dbg_io_ops->is_console
      is protected by the KDB_PAGER state variable which would only
      get set when kdb is fully active and initialized.  If we
      ever encounter changes or defects in the KDB_PAGER state
      we do not want to crash the kernel in a kdb_printf/printk.
      
      CC: Tim Bird <tim.bird@am.sony.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJason Wessel <jason.wessel@windriver.com>
      78724b8e
  2. 23 3月, 2012 7 次提交
  3. 19 3月, 2012 2 次提交
  4. 18 3月, 2012 2 次提交
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · c579bc7e
      Linus Torvalds 提交于
      Pull networking changes from David Miller:
       "1) icmp6_dst_alloc() returns NULL instead of ERR_PTR() leading to
           crashes, particularly during shutdown.  Reported by Dave Jones and
           fixed by Eric Dumazet.
      
        2) hyperv and wimax/i2400m return NETDEV_TX_BUSY when they have
           already freed the SKB, which causes crashes as to the caller this
           means requeue the packet.  Fixes from Eric Dumazet.
      
        3) usbnet driver doesn't allocate the right amount of headroom on
           fresh RX SKBs, fix from Eric Dumazet.
      
        4) Fix regression in ip6_mc_find_dev_rcu(), as an RCU lookup it
           abolutely should not take a reference to 'dev', this leads to
           leaks.  Fix from RonQing Li.
      
        5) Fix netfilter ctnetlink race between delete and timeout expiration.
           From Pablo Neira Ayuso.
      
        6) Revert SFQ change which causes regressions, specifically queueing
           to tail can lead to unavoidable flow starvation.  From Eric
           Dumazet.
      
        7) Fix a memory leak and a crash on corrupt firmware files in bnx2x,
           from Michal Schmidt."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        netfilter: ctnetlink: fix race between delete and timeout expiration
        ipv6: Don't dev_hold(dev) in ip6_mc_find_dev_rcu.
        wimax/i2400m: fix erroneous NETDEV_TX_BUSY use
        net/hyperv: fix erroneous NETDEV_TX_BUSY use
        net/usbnet: reserve headroom on rx skbs
        bnx2x: fix memory leak in bnx2x_init_firmware()
        bnx2x: fix a crash on corrupt firmware file
        sch_sfq: revert dont put new flow at the end of flows
        ipv6: fix icmp6_dst_alloc()
      c579bc7e
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 96ee0499
      Linus Torvalds 提交于
      Pull perf fixes from Ingo Molnar.
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools, x86: Build perf on older user-space as well
        perf tools: Use scnprintf where applicable
        perf tools: Incorrect use of snprintf results in SEGV
      96ee0499
  5. 17 3月, 2012 9 次提交
  6. 16 3月, 2012 17 次提交