Re: [RFC][PATCH] exec: Fix use after free of tracepoint trace_sched_process_exec

From: Linus Torvalds
Date: Tue Feb 04 2014 - 15:19:04 EST


On Tue, Feb 4, 2014 at 9:05 AM, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> This works, but is rather ugly.

Oh, please, that's a British-level understatement. It's like calling
WWII "a small bother".

That's too ugly to live.

> Looking for any other suggestions here.

Do we actually have to use "filename" at all?

We do have bprm->file, and we could get a path from that. It would be
more expensive, but for tracing execve that might be fine. Yes/no?

Or maybe we could just push the "putname(path)" into free_bprm() and
remove it from the callers. That's where we free bprm->interp anyway,
so it would kind of match.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/