1. 03 7月, 2013 3 次提交
    • Z
      uprobes: Fix return value in error handling path · fa44063f
      zhangwei(Jovi) 提交于
      When wrong argument is passed into uprobe_events it does not return
      an error:
      
      [root@jovi tracing]# echo 'p:myprobe /bin/bash' > uprobe_events
      [root@jovi tracing]#
      
      The proper response is:
      
      [root@jovi tracing]# echo 'p:myprobe /bin/bash' > uprobe_events
      -bash: echo: write error: Invalid argument
      
      Link: http://lkml.kernel.org/r/51B964FF.5000106@huawei.com
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: <srikar@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org # 3.5+
      Signed-off-by: Nzhangwei(Jovi) <jovi.zhangwei@huawei.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      fa44063f
    • S
      tracing: Fix race between deleting buffer and setting events · 2a6c24af
      Steven Rostedt (Red Hat) 提交于
      While analyzing the code, I discovered that there's a potential race between
      deleting a trace instance and setting events. There are a few races that can
      occur if events are being traced as the buffer is being deleted. Mostly the
      problem comes with freeing the descriptor used by the trace event callback.
      To prevent problems like this, the events are disabled before the buffer is
      deleted. The problem with the current solution is that the event_mutex is let
      go between disabling the events and freeing the files, which means that the events
      could be enabled again while the freeing takes place.
      
      Cc: stable@vger.kernel.org # 3.10
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      2a6c24af
    • S
      tracing: Add trace_array_get/put() to event handling · 8e2e2fa4
      Steven Rostedt (Red Hat) 提交于
      Commit a695cb58 "tracing: Prevent deleting instances when they are being read"
      tried to fix a race between deleting a trace instance and reading contents
      of a trace file. But it wasn't good enough. The following could crash the kernel:
      
       # cd /sys/kernel/debug/tracing/instances
       # ( while :; do mkdir foo; rmdir foo; done ) &
       # ( while :; do echo 1 > foo/events/sched/sched_switch 2> /dev/null; done ) &
      
      Luckily this can only be done by root user, but it should be fixed regardless.
      
      The problem is that a delete of the file can happen after the write to the event
      is opened, but before the enabling happens.
      
      The solution is to make sure the trace_array is available before succeeding in
      opening for write, and incerment the ref counter while opened.
      
      Now the instance can be deleted when the events are writing to the buffer,
      but the deletion of the instance will disable all events before the instance
      is actually deleted.
      
      Cc: stable@vger.kernel.org # 3.10
      Reported-by: NAlexander Lam <azl@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8e2e2fa4
  2. 02 7月, 2013 14 次提交
  3. 20 6月, 2013 5 次提交
  4. 12 6月, 2013 7 次提交
  5. 09 6月, 2013 11 次提交