History

kernel/kcov.c: mark funcs in __sanitizer_cov_trace_pc() as notrace

Since __sanitizer_cov_trace_pc() is marked as notrace, function calls in __sanitizer_cov_trace_pc() shouldn't be traced either. ftrace_graph_caller() gets called for each function that isn't marked 'notrace', like canonicalize_ip(). This is the call trace from a run: [ 139.644550] ftrace_graph_caller+0x1c/0x24 [ 139.648352] canonicalize_ip+0x18/0x28 [ 139.652313] __sanitizer_cov_trace_pc+0x14/0x58 [ 139.656184] sched_clock+0x34/0x1e8 [ 139.659759] trace_clock_local+0x40/0x88 [ 139.663722] ftrace_push_return_trace+0x8c/0x1f0 [ 139.667767] prepare_ftrace_return+0xa8/0x100 [ 139.671709] ftrace_graph_caller+0x1c/0x24 Rework so that check_kcov_mode() and canonicalize_ip() that are called from __sanitizer_cov_trace_pc() are also marked as notrace.

Anders Roxell committed 7 years ago

Commit 903e8ff1 parent e0c27441 file · +2 −2Browse files

Unified · Split

kernel/kcov.c+2−2
@@ -56,7 +56,7 @@ struct kcov { · 55 unmodified lines
5656 struct task_struct *t;
5757 };
5858
59−static bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t)
59+static notrace bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t)
6060 {
6161 unsigned int mode;
6262
@@ -78,7 +78,7 @@ static bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t) · 15 unmodified lines
7878 return mode == needed_mode;
7979 }
8080
81−static unsigned long canonicalize_ip(unsigned long ip)
81+static notrace unsigned long canonicalize_ip(unsigned long ip)
8282 {
8383 #ifdef CONFIG_RANDOMIZE_BASE
8484 ip -= kaslr_offset();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t