1
0
Fork 0
alistair23-linux/drivers/hwtracing/coresight
Sai Prakash Ranjan 152631f027 coresight: etb10: Fix possible NULL ptr dereference in etb_enable_perf()
commit 22b2beaa7f upstream.

There was a report of NULL pointer dereference in ETF enable
path for perf CS mode with PID monitoring. It is almost 100%
reproducible when the process to monitor is something very
active such as chrome and with ETF as the sink, not ETR.

But code path shows that ETB has a similar path as ETF, so
there could be possible NULL pointer dereference crash in
ETB as well. Currently in a bid to find the pid, the owner
is dereferenced via task_pid_nr() call in etb_enable_perf()
and with owner being NULL, we can get a NULL pointer
dereference, so have a similar fix as ETF where we cache PID
in alloc_buffer() callback which is called as the part of
etm_setup_aux().

Fixes: 75d7dbd388 ("coresight: etb10: Add support for CPU-wide trace scenarios")
Cc: stable@vger.kernel.org
Signed-off-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20201127175256.1092685-11-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:50:59 +01:00
..
Kconfig docs: fix a couple of new broken references 2019-07-31 14:12:26 -06:00
Makefile coresight: Rename of_coresight to coresight-platform 2019-06-20 07:56:10 +02:00
coresight-catu.c coresight: Use platform agnostic names 2019-06-20 07:56:13 +02:00
coresight-catu.h coresight: catu: Cleanup device specific data 2019-06-19 20:29:14 +02:00
coresight-cpu-debug.c coresight: cpu-debug: Add support for Qualcomm Kryo 2019-09-03 22:01:15 +02:00
coresight-etb10.c coresight: etb10: Fix possible NULL ptr dereference in etb_enable_perf() 2020-12-30 11:50:59 +01:00
coresight-etm-cp14.c coresight: Moving framework and drivers to SPDX identifier 2018-05-14 16:19:59 +02:00
coresight-etm-perf.c coresight: etm: perf: Fix warning caused by etm_setup_aux failure 2020-10-29 09:57:43 +01:00
coresight-etm-perf.h coresight: perf: Add "sinks" group to PMU directory 2019-02-08 12:27:36 +01:00
coresight-etm.h coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x-sysfs.c coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-etm3x.c coresight: Do not default to CPU0 for missing CPU phandle 2019-07-04 12:23:26 +02:00
coresight-etm4x-sysfs.c coresight: etm4x: Fix input validation for sysfs. 2019-12-13 08:42:43 +01:00
coresight-etm4x.c coresight: etm4x: Fix use-after-free of per-cpu etm drvdata 2020-10-01 13:18:02 +02:00
coresight-etm4x.h coresight: etm: Clean up device specific data 2019-06-19 20:29:14 +02:00
coresight-funnel.c coresight: Serialize enabling/disabling a link device. 2019-12-17 19:56:41 +01:00
coresight-platform.c drivers: Introduce device lookup variants by fwnode 2019-07-30 13:07:42 +02:00
coresight-priv.h coresight: tmc-etf: Fix NULL ptr dereference in tmc_enable_etf_sink_perf() 2020-12-30 11:50:59 +01:00
coresight-replicator.c coresight: Serialize enabling/disabling a link device. 2019-12-17 19:56:41 +01:00
coresight-stm.c coresight: stm: ACPI support for parsing stimulus base 2019-06-20 07:56:14 +02:00
coresight-tmc-etf.c coresight: tmc-etf: Fix NULL ptr dereference in tmc_enable_etf_sink_perf() 2020-12-30 11:50:59 +01:00
coresight-tmc-etr.c coresight: tmc-etr: Fix barrier packet insertion for perf buffer 2020-12-30 11:50:59 +01:00
coresight-tmc.c coresight: tmc: Make memory width mask computation into a function 2019-09-03 22:01:18 +02:00
coresight-tmc.h coresight: tmc: Make memory width mask computation into a function 2019-09-03 22:01:18 +02:00
coresight-tpiu.c coresight: Use platform agnostic names 2019-06-20 07:56:13 +02:00
coresight.c Revert "coresight: Make sysfs functional on topologies with per core sink" 2020-11-10 12:37:31 +01:00