android_kernel_motorola_sm6225/arch/x86/events
Nathan Chancellor 8bfc7a72ac x86/events/amd/iommu: Fix sysfs type mismatch
[ Upstream commit de5bc7b425d4c27ae5faa00ea7eb6b9780b9a355 ]

dev_attr_show() calls _iommu_event_show() via an indirect call but
_iommu_event_show()'s type does not currently match the type of the
show() member in 'struct device_attribute', resulting in a Control Flow
Integrity violation.

$ cat /sys/devices/amd_iommu_1/events/mem_dte_hit
csource=0x0a

$ dmesg | grep "CFI failure"
[ 3526.735140] CFI failure (target: _iommu_event_show...):

Change _iommu_event_show() and 'struct amd_iommu_event_desc' to
'struct device_attribute' so that there is no more CFI violation.

Fixes: 7be6296fdd ("perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210415001112.3024673-1-nathan@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-22 10:59:34 +02:00
..
amd x86/events/amd/iommu: Fix sysfs type mismatch 2021-05-22 10:59:34 +02:00
intel perf/x86/intel/uncore: Remove uncore extra PCI dev HSWEP_PCI_PCU_3 2021-04-28 13:16:52 +02:00
core.c perf/x86/intel: Fix PT PMI handling 2020-01-12 12:17:19 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile perf/x86/events: Add an AMD-specific Makefile 2017-01-30 12:01:19 +01:00
msr.c perf/x86/msr: Add Icelake support 2019-05-31 06:46:21 -07:00
perf_event.h perf/x86: Fix incorrect PEBS_REGS 2019-04-27 09:36:38 +02:00