Files
linux/arch/s390/include/asm
Sven Schnelle ddf4aada93 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:36:20 +01:00
..
2017-12-05 07:51:09 +01:00
2018-04-10 07:38:59 +02:00
2019-05-04 09:20:11 +02:00
2019-07-21 09:03:14 +02:00
2018-04-16 09:10:23 +02:00
2018-07-04 08:35:58 +02:00
2018-05-30 11:18:03 +02:00
2018-06-25 10:14:37 +02:00
2018-07-02 11:24:58 +02:00
2017-12-05 07:51:09 +01:00