[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0cb9c9b8ce069a92df8b974d520606a494614892.camel@perches.com>
Date: Fri, 26 Feb 2021 20:04:28 -0800
From: Joe Perches <joe@...ches.com>
To: Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Jacob Wen <jian.w.wen@...cle.com>
Subject: Re: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers
from trace events
On Fri, 2021-02-26 at 18:33 -0500, Steven Rostedt wrote:
> On Fri, 26 Feb 2021 14:21:00 -0800
> Linus Torvalds <torvalds@...ux-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.
Powered by blists - more mailing lists