1
0
Fork 0
alistair23-linux/arch/s390
Sven Schnelle 19f8631f2b s390/ftrace: fix endless recursion in function_graph tracer
[ Upstream commit 6feeee8efc ]

The following sequence triggers a kernel stack overflow on s390x:

mount -t tracefs tracefs /sys/kernel/tracing
cd /sys/kernel/tracing
echo function_graph > current_tracer
[crash]

This is because preempt_count_{add,sub} are in the list of traced
functions, which can be demonstrated by:

echo preempt_count_add >set_ftrace_filter
echo function_graph > current_tracer
[crash]

The stack overflow happens because get_tod_clock_monotonic() gets called
by ftrace but itself calls preempt_{disable,enable}(), which leads to a
endless recursion. Fix this by using preempt_{disable,enable}_notrace().

Fixes: 011620688a ("s390/time: ensure get_clock_monotonic() returns monotonic values")
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:46:02 +01:00
..
appldata proc/sysctl: add shared variables for range check 2019-07-18 17:08:07 -07:00
boot s390/kaslr: store KASLR offset for early dumps 2019-12-17 19:56:51 +01:00
configs s390: update defconfigs 2019-10-04 16:37:33 +02:00
crypto s390/crypto: Fix unsigned variable compared with zero 2019-12-31 16:45:41 +01:00
hypfs Merge branch 'work.mount3' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-09-24 12:33:34 -07:00
include s390/ftrace: fix endless recursion in function_graph tracer 2019-12-31 16:46:02 +01:00
kernel s390/cpumf: Adjust registration of s390 PMU device drivers 2019-12-31 16:45:43 +01:00
kvm KVM: s390: mark __insn32_query() as __always_inline 2019-10-05 13:51:22 +02:00
lib s390 updates for the 5.4 merge window 2019-09-17 14:04:43 -07:00
mm s390/kasan: support memcpy_real with TRACE_IRQFLAGS 2019-12-31 16:45:41 +01:00
net s390/bpf: Use kvcalloc for addrs array 2019-12-31 16:45:06 +01:00
numa s390/numa: correct early_param handling 2019-08-26 12:51:17 +02:00
oprofile s390/unwind: introduce stack unwind API 2019-05-02 13:54:11 +02:00
pci s390/pci: mark function(s) __always_inline 2019-10-04 16:37:33 +02:00
purgatory crypto: sha256 - Merge crypto/sha256.h into crypto/sha.h 2019-09-05 14:54:54 +10:00
scripts s390/build: use size command to perform empty .bss check 2019-08-08 14:36:53 +02:00
tools s390: add support for IBM z15 machines 2019-09-13 12:19:14 +02:00
Kbuild s390/kexec_file: Add purgatory 2018-04-16 09:10:22 +02:00
Kconfig Merge branch 'next-lockdown' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-09-28 08:14:15 -07:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile s390: add support for IBM z15 machines 2019-09-13 12:19:14 +02:00