aboutsummaryrefslogtreecommitdiffstats
path: root/samples/ftrace/ftrace-direct.c
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2020-11-13 10:34:14 -0800
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-11-30 21:42:48 -0500
commit983df5f2699f83f78643b19d3399b160d1e64f5b (patch)
treeb4d34490033c32d86f3e51480f7d3f91b985cc90 /samples/ftrace/ftrace-direct.c
parentring-buffer: Set the right timestamp in the slow path of __rb_reserve_next() (diff)
downloadlinux-dev-983df5f2699f83f78643b19d3399b160d1e64f5b.tar.xz
linux-dev-983df5f2699f83f78643b19d3399b160d1e64f5b.zip
samples/ftrace: Mark my_tramp[12]? global
my_tramp[12]? are declared as global functions in C, but they are not marked global in the inline assembly definition. This mismatch confuses Clang's Control-Flow Integrity checking. Fix the definitions by adding .globl. Link: https://lkml.kernel.org/r/20201113183414.1446671-1-samitolvanen@google.com Fixes: 9d907f1ae80b8 ("ftrace/samples: Add a sample module that implements modify_ftrace_direct()") Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'samples/ftrace/ftrace-direct.c')
-rw-r--r--samples/ftrace/ftrace-direct.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/samples/ftrace/ftrace-direct.c b/samples/ftrace/ftrace-direct.c
index 63ca06d42c80..a2729d1ef17f 100644
--- a/samples/ftrace/ftrace-direct.c
+++ b/samples/ftrace/ftrace-direct.c
@@ -14,6 +14,7 @@ extern void my_tramp(void *);
asm (
" .pushsection .text, \"ax\", @progbits\n"
" .type my_tramp, @function\n"
+" .globl my_tramp\n"
" my_tramp:"
" pushq %rbp\n"
" movq %rsp, %rbp\n"