lkml.org 
[lkml]   [2010]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] tracing: Do not record user stack trace from NMI context
On Sun, Mar 14, 2010 at 12:58:40PM -0400, Steven Rostedt wrote:
> On Sun, 2010-03-14 at 11:27 +0100, Frederic Weisbecker wrote:
>
> >
> > Wow, that's a race :)
> >
> > In perf this is dealt with a special copy_from_user_nmi()
> > (see in arch/x86/kernel/cpu/perf_event.c)
> >
> > May be save_stack_trace_user() should use that instead
> > of a __copy_from_user_inatomic() based thing, just to
> > cover such NMI corner race case.
> >
>
> Yeah, we should move the __copy_from_user_nmi() out of the perf code and
> into the normal uaccess code. Then we could do as you suggest, and have
> the stack code do:
>
> if (in_nmi())
> __copy_from_user_nmi();
> else
> __copy_from_user_inatomic();
>
> Or maybe it would be best to have the __copy_from_user_inatomic() handle
> it.


Yeah, agreed.



\
 
 \ /
  Last update: 2010-03-17 03:11    [from the cache]
©2003-2011 Jasper Spaans