diff options
author | Minchan Kim <minchan@kernel.org> | 2020-11-26 01:56:54 +0300 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2020-12-01 05:43:07 +0300 |
commit | 8fa655a3a0013a0c2a2aada6f39a93ee6fc25549 (patch) | |
tree | 6ce632720bc043a5ada50fa9483bd4504dfb5c90 /kernel/trace/ftrace.c | |
parent | 310e3a4b5a4fc718a72201c1e4cf5c64ac6f5442 (diff) | |
download | linux-8fa655a3a0013a0c2a2aada6f39a93ee6fc25549.tar.xz |
tracing: Fix alignment of static buffer
With 5.9 kernel on ARM64, I found ftrace_dump output was broken but
it had no problem with normal output "cat /sys/kernel/debug/tracing/trace".
With investigation, it seems coping the data into temporal buffer seems to
break the align binary printf expects if the static buffer is not aligned
with 4-byte. IIUC, get_arg in bstr_printf expects that args has already
right align to be decoded and seq_buf_bprintf says ``the arguments are saved
in a 32bit word array that is defined by the format string constraints``.
So if we don't keep the align under copy to temporal buffer, the output
will be broken by shifting some bytes.
This patch fixes it.
Link: https://lkml.kernel.org/r/20201125225654.1618966-1-minchan@kernel.org
Cc: <stable@vger.kernel.org>
Fixes: 8e99cf91b99bb ("tracing: Do not allocate buffer in trace_find_next_entry() in atomic")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
0 files changed, 0 insertions, 0 deletions