lkml.org 
[lkml]   [2021]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers from trace events
From
Date
On Fri, 2021-02-26 at 18:33 -0500, Steven Rostedt wrote:
> On Fri, 26 Feb 2021 14:21:00 -0800
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> > > The second patch handles strings "%s" [..]
> >
> > Doing this at runtime really feels like the wrong thing to do.
> >
> > It won't even protect us from what happened - people like me and
> > Andrew won't even run those tracepoints in the first place, so we
> > won't notice.
> >
> > It really would be much better in every respect to have this done by
> > checkpatch, I think.
>
> They are not mutually exclusive. We could have both. One thing that's nice
> about this patch is that it removes the possibility of a real bug. That is,
> it will catch the dereferencing of a string that is not valid, WARN about
> it, but it wont try to dereference it (outside of the
> strcpy_from_kernel_nofault()). And hopefully the warning and lack of data
> they want, will have this get caught during development.
>
> Also, there's cases that %s is allowed to reference data that I don't know
> if checkpatch would be able to differentiate.

It's not obvious to me how to do that.


\
 
 \ /
  Last update: 2021-02-27 05:06    [W:1.746 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site