Repository navigation
Commit bc394fa
ftrace: Setup correct FTRACE_FL_REGS flags for module
commit 8a224ff upstream.
When module loaded and enabled, we will use __ftrace_replace_code
for module if any ftrace_ops referenced it found. But we will get
wrong ftrace_addr for module rec in ftrace_get_addr_new, because
rec->flags has not been setup correctly. It can cause the callback
function of a ftrace_ops has FTRACE_OPS_FL_SAVE_REGS to be called
with pt_regs set to NULL.
So setup correct FTRACE_FL_REGS flags for rec when we call
referenced_filters to find ftrace_ops references it.
Link: https://lkml.kernel.org/r/20200728180554.65203-1-zhouchengming@bytedance.com
Cc: stable@vger.kernel.org
Fixes: 8c4f3c3 ("ftrace: Check module functions being traced on reload")
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent d6cf27c commit bc394fa
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6187 | 6187 | | |
6188 | 6188 | | |
6189 | 6189 | | |
6190 | | - | |
6191 | | - | |
| 6190 | + | |
| 6191 | + | |
| 6192 | + | |
| 6193 | + | |
| 6194 | + | |
6192 | 6195 | | |
6193 | 6196 | | |
6194 | 6197 | | |
| |||
6367 | 6370 | | |
6368 | 6371 | | |
6369 | 6372 | | |
6370 | | - | |
6371 | | - | |
| 6373 | + | |
| 6374 | + | |
6372 | 6375 | | |
6373 | 6376 | | |
6374 | 6377 | | |
| |||
0 commit comments