Message ID | CAGXu5jLkc2oFouYq3ZT1sUvgjjJY32_uEcuLLE4wHX-N0cFiFw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Apr 08, 2014 at 01:19:01PM -0700, Kees Cook wrote: > > To prevent any stale entries being used indefinitely, perhaps the all > > CPU TLB flush can be inserted into > > ftrace_arch_code_modify_post_process(), which is called after the > > stop_machine() and which is where x86 for example makes the entries > > read-only again. > > Do you mean something like this? Yes, something like that should probably be sufficient. > > diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c > index ea446ae09c89..b8c75e45a950 100644 > --- a/arch/arm/kernel/ftrace.c > +++ b/arch/arm/kernel/ftrace.c > @@ -90,6 +90,8 @@ int ftrace_arch_code_modify_prepare(void) > int ftrace_arch_code_modify_post_process(void) > { > set_all_modules_text_ro(); > + /* Make sure any TLB misses during machine stop are cleared. */ > + flush_tlb_all(); > return 0; > }
diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c index ea446ae09c89..b8c75e45a950 100644 --- a/arch/arm/kernel/ftrace.c +++ b/arch/arm/kernel/ftrace.c @@ -90,6 +90,8 @@ int ftrace_arch_code_modify_prepare(void) int ftrace_arch_code_modify_post_process(void) { set_all_modules_text_ro(); + /* Make sure any TLB misses during machine stop are cleared. */ + flush_tlb_all(); return 0; }