Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Sami Tolvanen
On Mon, Nov 16, 2020 at 1:18 PM Steven Rostedt wrote: > > On Mon, 16 Nov 2020 13:10:57 -0800 > Sami Tolvanen wrote: > > > Clang doesn't warn about this as we're building a module, it just > > generates a reference to a non-existing global "my_tramp" symbol, > > because the one defined in inline a

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Steven Rostedt
On Mon, 16 Nov 2020 13:10:57 -0800 Sami Tolvanen wrote: > Clang doesn't warn about this as we're building a module, it just > generates a reference to a non-existing global "my_tramp" symbol, > because the one defined in inline assembly has a local binding: > > $ readelf --symbols --wide ftrace-

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Sami Tolvanen
On Mon, Nov 16, 2020 at 12:38 PM Steven Rostedt wrote: > > On Mon, 16 Nov 2020 12:10:10 -0800 > Sami Tolvanen wrote: > > > On Mon, Nov 16, 2020 at 8:39 AM Steven Rostedt wrote: > > > > > > On Fri, 13 Nov 2020 10:34:14 -0800 > > > Sami Tolvanen wrote: > > > > > > > my_tramp[12]? are declared as

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Steven Rostedt
On Mon, 16 Nov 2020 12:10:10 -0800 Sami Tolvanen wrote: > On Mon, Nov 16, 2020 at 8:39 AM Steven Rostedt wrote: > > > > On Fri, 13 Nov 2020 10:34:14 -0800 > > Sami Tolvanen wrote: > > > > > my_tramp[12]? are declared as global functions in C, but they are not > > > marked global in the inline

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Sami Tolvanen
On Mon, Nov 16, 2020 at 8:39 AM Steven Rostedt wrote: > > On Fri, 13 Nov 2020 10:34:14 -0800 > Sami Tolvanen wrote: > > > 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 Inte

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-16 Thread Steven Rostedt
On Fri, 13 Nov 2020 10:34:14 -0800 Sami Tolvanen wrote: > 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. > Actually

Re: [PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-13 Thread Kees Cook
On Fri, Nov 13, 2020 at 10:34:14AM -0800, Sami Tolvanen wrote: > 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. > > Si

[PATCH] samples/ftrace: mark my_tramp[12]? global

2020-11-13 Thread Sami Tolvanen
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. Signed-off-by: Sami Tolvanen --- samples/ftrace/ftrace-direct-modify.c | 2