1. 10 12月, 2010 1 次提交
  2. 09 12月, 2010 1 次提交
    • P
      perf: Stop all counters on reboot · c277443c
      Peter Zijlstra 提交于
      Use the reboot notifier to detach all running counters on reboot, this
      solves a problem with kexec where the new kernel doesn't expect
      running counters (rightly so).
      
      It will however decrease the coverage of the NMI watchdog. Making a
      kexec specific reboot notifier callback would be best, however that
      would require touching all notifier callback handlers as they are not
      properly structured to deal with new state.
      
      As a compromise, place the perf reboot notifier at the very last
      position in the list.
      Reported-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Don Zickus <dzickus@redhat.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c277443c
  3. 07 12月, 2010 9 次提交
    • R
      PM / Hibernate: Fix memory corruption related to swap · c9e664f1
      Rafael J. Wysocki 提交于
      There is a problem that swap pages allocated before the creation of
      a hibernation image can be released and used for storing the contents
      of different memory pages while the image is being saved.  Since the
      kernel stored in the image doesn't know of that, it causes memory
      corruption to occur after resume from hibernation, especially on
      systems with relatively small RAM that need to swap often.
      
      This issue can be addressed by keeping the GFP_IOFS bits clear
      in gfp_allowed_mask during the entire hibernation, including the
      saving of the image, until the system is finally turned off or
      the hibernation is aborted.  Unfortunately, for this purpose
      it's necessary to rework the way in which the hibernate and
      suspend code manipulates gfp_allowed_mask.
      
      This change is based on an earlier patch from Hugh Dickins.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reported-by: NOndrej Zary <linux@rainbow-software.org>
      Acked-by: NHugh Dickins <hughd@google.com>
      Reviewed-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: stable@kernel.org
      c9e664f1
    • B
      PM / Hibernate: Use async I/O when reading compressed hibernation image · 9f339caf
      Bojan Smojver 提交于
      This is a fix for reading LZO compressed image using async I/O.
      Essentially, instead of having just one page into which we keep
      reading blocks from swap, we allocate enough of them to cover the
      largest compressed size and then let block I/O pick them all up. Once
      we have them all (and here we wait), we decompress them, as usual.
      Obviously, the very first block we still pick up synchronously,
      because we need to know the size of the lot before we pick up the
      rest.
      
      Also fixed the copyright line, which I've forgotten before.
      Signed-off-by: NBojan Smojver <bojan@rexursive.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      9f339caf
    • M
      kprobes: Use text_poke_smp_batch for unoptimizing · f984ba4e
      Masami Hiramatsu 提交于
      Use text_poke_smp_batch() on unoptimization path for reducing
      the number of stop_machine() issues. If the number of
      unoptimizing probes is more than MAX_OPTIMIZE_PROBES(=256),
      kprobes unoptimizes first MAX_OPTIMIZE_PROBES probes and kicks
      optimizer for remaining probes.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20101203095434.2961.22657.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f984ba4e
    • M
      kprobes: Use text_poke_smp_batch for optimizing · cd7ebe22
      Masami Hiramatsu 提交于
      Use text_poke_smp_batch() in optimization path for reducing
      the number of stop_machine() issues. If the number of optimizing
      probes is more than MAX_OPTIMIZE_PROBES(=256), kprobes optimizes
      first MAX_OPTIMIZE_PROBES probes and kicks optimizer for
      remaining probes.
      
      Changes in v5:
      - Use kick_kprobe_optimizer() instead of directly calling
        schedule_delayed_work().
      - Rescheduling optimizer outside of kprobe mutex lock.
      
      Changes in v2:
      - Allocate code buffer and parameters in arch_init_kprobes()
        instead of using static arraies.
      - Merge previous max optimization limit patch into this patch.
        So, this patch introduces upper limit of optimization at
        once.
      Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <20101203095428.2961.8994.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cd7ebe22
    • M
      kprobes: Reuse unused kprobe · 0490cd1f
      Masami Hiramatsu 提交于
      Reuse unused (waiting for unoptimizing and no user handler)
      kprobe on given address instead of returning -EBUSY for
      registering a new kprobe.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20101203095416.2961.39080.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0490cd1f
    • M
      kprobes: Support delayed unoptimizing · 6274de49
      Masami Hiramatsu 提交于
      Unoptimization occurs when a probe is unregistered or disabled,
      and is heavy because it recovers instructions by using
      stop_machine(). This patch delays unoptimization operations and
      unoptimize several probes at once by using
      text_poke_smp_batch(). This can avoid unexpected system slowdown
      coming from stop_machine().
      
      Changes in v5:
      - Split this patch into several cleanup patches and this patch.
      - Fix some text_mutex lock miss.
      - Use bool instead of int for behavior flags.
      - Add additional comment for (un)optimizing path.
      
      Changes in v2:
      - Use dynamic allocated buffers and params.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20101203095409.2961.82733.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6274de49
    • M
      kprobes: Separate kprobe optimizing code from optimizer · 61f4e13f
      Masami Hiramatsu 提交于
      Separate kprobe optimizing code from optimizer, this
      will make easy to introducing unoptimizing code in
      optimizer.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20101203095403.2961.91201.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61f4e13f
    • M
      kprobes: Cleanup disabling and unregistering path · 6f0f1dd7
      Masami Hiramatsu 提交于
      Merge disabling kprobe to unregistering kprobe function
      and add comments for disabing/unregistring process.
      
      Current unregistering code disables(disarms) kprobes after
      checking target kprobe status. This patch changes it to
      disabling kprobe first after that it changing the kprobe's
      state. This allows to share probe disabling code between
      disable_kprobe() and unregister_kprobe().
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20101203095356.2961.30152.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6f0f1dd7
    • M
      kprobes: Rename old_p to more appropriate name · 6d8e40a8
      Masami Hiramatsu 提交于
      Rename irrelevant uses of "old_p" to more appropriate names.
      Originally, "old_p" just meant "the old kprobe on given address"
      but current code uses that name as "just another kprobe" or
      something like that. This patch renames those pointer names
      to more appropriate one for maintainability.
      Signed-off-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Cc: Jason Baron <jbaron@redhat.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: 2nddept-manager@sdl.hitachi.co.jp
      LKML-Reference: <20101203095350.2961.48110.stgit@ltc236.sdl.hitachi.co.jp>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6d8e40a8
  4. 05 12月, 2010 3 次提交
  5. 03 12月, 2010 1 次提交
    • N
      do_exit(): make sure that we run with get_fs() == USER_DS · 33dd94ae
      Nelson Elhage 提交于
      If a user manages to trigger an oops with fs set to KERNEL_DS, fs is not
      otherwise reset before do_exit().  do_exit may later (via mm_release in
      fork.c) do a put_user to a user-controlled address, potentially allowing
      a user to leverage an oops into a controlled write into kernel memory.
      
      This is only triggerable in the presence of another bug, but this
      potentially turns a lot of DoS bugs into privilege escalations, so it's
      worth fixing.  I have proof-of-concept code which uses this bug along
      with CVE-2010-3849 to write a zero to an arbitrary kernel address, so
      I've tested that this is not theoretical.
      
      A more logical place to put this fix might be when we know an oops has
      occurred, before we call do_exit(), but that would involve changing
      every architecture, in multiple places.
      
      Let's just stick it in do_exit instead.
      
      [akpm@linux-foundation.org: update code comment]
      Signed-off-by: NNelson Elhage <nelhage@ksplice.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      33dd94ae
  6. 01 12月, 2010 1 次提交
  7. 26 11月, 2010 7 次提交
  8. 20 11月, 2010 1 次提交
    • L
      Revert "kernel: make /proc/kallsyms mode 400 to reduce ease of attacking" · 33e0d57f
      Linus Torvalds 提交于
      This reverts commit 59365d13.
      
      It turns out that this can break certain existing user land setups.
      Quoth Sarah Sharp:
      
       "On Wednesday, I updated my branch to commit 460781b5 from linus' tree,
        and my box would not boot.  klogd segfaulted, which stalled the whole
        system.
      
        At first I thought it actually hung the box, but it continued booting
        after 5 minutes, and I was able to log in.  It dropped back to the
        text console instead of the graphical bootup display for that period
        of time.  dmesg surprisingly still works.  I've bisected the problem
        down to this commit (commit 59365d13)
      
        The box is running klogd 1.5.5ubuntu3 (from Jaunty).  Yes, I know
        that's old.  I read the bit in the commit about changing the
        permissions of kallsyms after boot, but if I can't boot that doesn't
        help."
      
      So let's just keep the old default, and encourage distributions to do
      the "chmod -r /proc/kallsyms" in their bootup scripts.  This is not
      worth a kernel option to change default behavior, since it's so easily
      done in user space.
      Reported-and-bisected-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Marcus Meissner <meissner@suse.de>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Eugene Teo <eugeneteo@kernel.org>
      Cc: Jesper Juhl <jj@chaosbits.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      33e0d57f
  9. 18 11月, 2010 9 次提交
  10. 17 11月, 2010 1 次提交
    • M
      kernel: make /proc/kallsyms mode 400 to reduce ease of attacking · 59365d13
      Marcus Meissner 提交于
      Making /proc/kallsyms readable only for root by default makes it
      slightly harder for attackers to write generic kernel exploits by
      removing one source of knowledge where things are in the kernel.
      
      This is the second submit, discussion happened on this on first submit
      and mostly concerned that this is just one hole of the sieve ...  but
      one of the bigger ones.
      
      Changing the permissions of at least System.map and vmlinux is also
      required to fix the same set, but a packaging issue.
      
      Target of this starter patch and follow ups is removing any kind of
      kernel space address information leak from the kernel.
      
      [ Side note: the default of root-only reading is the "safe" value, and
        it's easy enough to then override at any time after boot.  The /proc
        filesystem allows root to change the permissions with a regular
        chmod, so you can "revert" this at run-time by simply doing
      
          chmod og+r /proc/kallsyms
      
        as root if you really want regular users to see the kernel symbols.
        It does help some tools like "perf" figure them out without any
        setup, so it may well make sense in some situations.  - Linus ]
      Signed-off-by: NMarcus Meissner <meissner@suse.de>
      Acked-by: NTejun Heo <tj@kernel.org>
      Acked-by: NEugene Teo <eugeneteo@kernel.org>
      Reviewed-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59365d13
  11. 16 11月, 2010 3 次提交
  12. 13 11月, 2010 1 次提交
    • S
      tracing: Fix recursive user stack trace · 91e86e56
      Steven Rostedt 提交于
      The user stack trace can fault when examining the trace. Which
      would call the do_page_fault handler, which would trace again,
      which would do the user stack trace, which would fault and call
      do_page_fault again ...
      
      Thus this is causing a recursive bug. We need to have a recursion
      detector here.
      
      [ Resubmitted by Jiri Olsa ]
      
      [ Eric Dumazet recommended using __this_cpu_* instead of __get_cpu_* ]
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      LKML-Reference: <1289390172-9730-3-git-send-email-jolsa@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      91e86e56
  13. 12 11月, 2010 2 次提交