linux/drivers/hwtracing/coresight
Suzuki K Poulose ec48a1d981 coresight: Fix NULL pointer dereference in _coresight_build_path
_coresight_build_path assumes that all the connections of a csdev
has the child_dev initialised. This may not be true if the particular
component is not supported by the kernel config(e.g TPIU) but is
present in the DT. In which case, building a path can cause a crash like this :

  Unable to handle kernel NULL pointer dereference at virtual address 00000010
  pgd = ffffffc9750dd000
  [00000010] *pgd=00000009f5e90003, *pud=00000009f5e90003, *pmd=0000000000000000
  Internal error: Oops: 96000006 [#1] PREEMPT SMP
  Modules linked in:
  CPU: 4 PID: 1348 Comm: bash Not tainted 4.6.0-next-20160517 #1646
  Hardware name: ARM Juno development board (r0) (DT)
  task: ffffffc97517a280 ti: ffffffc9762c4000 task.ti: ffffffc9762c4000
  PC is at _coresight_build_path+0x18/0xe4
  LR is at _coresight_build_path+0xc0/0xe4
  pc : [<ffffff80083d5130>] lr : [<ffffff80083d51d8>] pstate: 20000145
  sp : ffffffc9762c7ba0

  [<ffffff80083d5130>] _coresight_build_path+0x18/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d5cdc>] coresight_build_path+0x40/0x68
  [<ffffff80083d5e14>] coresight_enable+0x74/0x1bc
  [<ffffff80083d60a0>] enable_source_store+0x3c/0x6c
  [<ffffff800830b17c>] dev_attr_store+0x18/0x28
  [<ffffff80081ca9c4>] sysfs_kf_write+0x40/0x50
  [<ffffff80081c9e38>] kernfs_fop_write+0x140/0x1cc
  [<ffffff8008163ec8>] __vfs_write+0x28/0x110
  [<ffffff8008164bf0>] vfs_write+0xa0/0x174
  [<ffffff8008165d18>] SyS_write+0x44/0xa0
  [<ffffff8008084e70>] el0_svc_naked+0x24/0x28

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-16 00:13:06 -07:00
..
coresight-etb10.c coresight: etb10: adjust read pointer only when needed 2016-05-03 14:59:30 -07:00
coresight-etm3x-sysfs.c coresight: moving coresight_simple_func() to header file 2016-05-01 14:12:14 -07:00
coresight-etm3x.c drivers/hwtracing: make coresight-* explicitly non-modular 2016-02-20 14:11:01 -08:00
coresight-etm4x-sysfs.c coresight: moving coresight_simple_func() to header file 2016-05-01 14:12:14 -07:00
coresight-etm4x.c coresight: etm4x: add tracer ID for A72 Maia processor. 2016-05-03 14:59:30 -07:00
coresight-etm4x.h coresight: etm4x: modify q_support type 2016-05-03 14:59:30 -07:00
coresight-etm-cp14.c
coresight-etm-perf.c drivers/hwtracing: make coresight-etm-perf.c explicitly non-modular 2016-03-05 12:19:39 -08:00
coresight-etm-perf.h coresight: etm-perf: new PMU driver for ETM tracers 2016-02-20 14:11:01 -08:00
coresight-etm.h coresight: etm3x: implementing user/kernel mode tracing 2016-02-20 14:11:01 -08:00
coresight-funnel.c coresight: removing gratuitous boot time log messages 2016-05-01 14:12:14 -07:00
coresight-priv.h coresight: moving struct cs_buffers to header file 2016-05-03 14:59:30 -07:00
coresight-replicator-qcom.c drivers/hwtracing: make coresight-* explicitly non-modular 2016-02-20 14:11:01 -08:00
coresight-replicator.c coresight: removing gratuitous boot time log messages 2016-05-01 14:12:14 -07:00
coresight-stm.c coresight: stm: adding driver for CoreSight STM component 2016-05-03 14:59:30 -07:00
coresight-tmc-etf.c coresight: tmc: implementing TMC-ETF AUX space API 2016-05-03 14:59:30 -07:00
coresight-tmc-etr.c coresight: tmc: make sysFS and Perf mode mutually exclusive 2016-05-03 14:59:30 -07:00
coresight-tmc.c coresight: tmc: keep track of memory width 2016-05-03 14:59:30 -07:00
coresight-tmc.h coresight: tmc: implementing TMC-ETF AUX space API 2016-05-03 14:59:30 -07:00
coresight-tpiu.c coresight: removing gratuitous boot time log messages 2016-05-01 14:12:14 -07:00
coresight.c coresight: Fix NULL pointer dereference in _coresight_build_path 2016-06-16 00:13:06 -07:00
Kconfig coresight: stm: adding driver for CoreSight STM component 2016-05-03 14:59:30 -07:00
Makefile coresight: tmc: splitting driver in ETB/ETF and ETR components 2016-05-03 14:59:30 -07:00
of_coresight.c drivers/hwtracing: make coresight-* explicitly non-modular 2016-02-20 14:11:01 -08:00