linux-uconsole/include
Steven Rostedt (VMware) 392374326d function_graph: Use new curr_ret_depth to manage depth instead of curr_ret_stack
commit 39eb456dac upstream.

Currently, the depth of the ret_stack is determined by curr_ret_stack index.
The issue is that there's a race between setting of the curr_ret_stack and
calling of the callback attached to the return of the function.

Commit 03274a3ffb ("tracing/fgraph: Adjust fgraph depth before calling
trace return callback") moved the calling of the callback to after the
setting of the curr_ret_stack, even stating that it was safe to do so, when
in fact, it was the reason there was a barrier() there (yes, I should have
commented that barrier()).

Not only does the curr_ret_stack keep track of the current call graph depth,
it also keeps the ret_stack content from being overwritten by new data.

The function profiler, uses the "subtime" variable of ret_stack structure
and by moving the curr_ret_stack, it allows for interrupts to use the same
structure it was using, corrupting the data, and breaking the profiler.

To fix this, there needs to be two variables to handle the call stack depth
and the pointer to where the ret_stack is being used, as they need to change
at two different locations.

Cc: stable@kernel.org
Fixes: 03274a3ffb ("tracing/fgraph: Adjust fgraph depth before calling trace return callback")
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 19:32:10 +01:00
..
acpi
asm-generic vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections 2018-10-12 08:55:29 +11:00
clocksource
crypto crypto: speck - remove Speck 2018-11-13 11:08:46 -08:00
drm drm: Get ref on CRTC commit object when waiting for flip_done 2018-10-18 14:23:13 -04:00
dt-bindings ARM: SoC: late updates 2018-08-25 14:12:36 -07:00
keys
kvm
linux function_graph: Use new curr_ret_depth to manage depth instead of curr_ret_stack 2018-12-05 19:32:10 +01:00
math-emu
media media: cec: fix the Signal Free Time calculation 2018-11-13 11:08:53 -08:00
memory
misc
net tcp: do not release socket ownership in tcp_close() 2018-12-01 09:37:28 +01:00
pcmcia pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
ras
rdma IB/rxe: Revise the ib_wr_opcode enum 2018-11-13 11:08:43 -08:00
scsi
soc soc: fsl: qbman: add APIs to retrieve the probing status 2018-09-27 15:43:35 -05:00
sound ASoC: Fixes for v4.19 2018-09-17 18:59:21 +02:00
target
trace RxRPC fixes 2018-10-10 22:27:38 -07:00
uapi x86/speculation: Add prctl() control for indirect branch speculation 2018-12-05 19:32:04 +01:00
video fbdev changes for v4.19: 2018-08-23 15:44:58 -07:00
xen CONFIG_XEN_PV breaks xen_create_contiguous_region on ARM 2018-11-21 09:19:28 +01:00