diff options
| author | Ravi Bangoria <ravi.bangoria@linux.ibm.com> | 2018-04-20 20:37:58 +0530 | 
|---|---|---|
| committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-04-25 10:27:55 -0400 | 
| commit | ba16293dad626d3e3827cfe0a1a743c1d93e76b7 (patch) | |
| tree | b2849efbc604dbdbf3e2b8906a1e511828918b74 /net/lapb/lapb_iface.c | |
| parent | 1c758a2202a6b4624d0703013a2c6cfa6e7455aa (diff) | |
tracing: Fix kernel crash while using empty filter with perf
Kernel is crashing when user tries to record 'ftrace:function' event
with empty filter:
  # perf record -e ftrace:function --filter="" ls
  # dmesg
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
  Oops: 0000 [#1] SMP PTI
  ...
  RIP: 0010:ftrace_profile_set_filter+0x14b/0x2d0
  RSP: 0018:ffffa4a7c0da7d20 EFLAGS: 00010246
  RAX: ffffa4a7c0da7d64 RBX: 0000000000000000 RCX: 0000000000000006
  RDX: 0000000000000000 RSI: 0000000000000092 RDI: ffff8c48ffc968f0
  ...
  Call Trace:
   _perf_ioctl+0x54a/0x6b0
   ? rcu_all_qs+0x5/0x30
  ...
After patch:
  # perf record -e ftrace:function --filter="" ls
  failed to set filter "" on event ftrace:function with 22 (Invalid argument)
Also, if user tries to echo "" > filter, it used to throw an error.
This behavior got changed by commit 80765597bc58 ("tracing: Rewrite
filter logic to be simpler and faster"). This patch restores the
behavior as a side effect:
Before patch:
  # echo "" > filter
  #
After patch:
  # echo "" > filter
  bash: echo: write error: Invalid argument
  #
Link: http://lkml.kernel.org/r/20180420150758.19787-1-ravi.bangoria@linux.ibm.com
Fixes: 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster")
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'net/lapb/lapb_iface.c')
0 files changed, 0 insertions, 0 deletions
