Re: [PATCH 3/3] exec: Transform exec_update_mutex into a rw_semaphore

From: Linus Torvalds
Date: Fri Dec 04 2020 - 15:50:26 EST


On Fri, Dec 4, 2020 at 12:30 PM Bernd Edlinger
<bernd.edlinger@xxxxxxxxxx> wrote:
>>
> > perf_event_open (exec_update_mutex -> ovl_i_mutex)

Side note: this one looks like it should be easy to fix.

Is there any real reason why exec_update_mutex is actually gotten that
early, and held for that long in the perf event code?

I _think_ we could move the ptrace check to be much later, to _just_ before that

* This is the point on no return; we cannot fail hereafter.

point in the perf event install chain..

I don't think it needs to be moved down even that much, I think it
would be sufficient to move it down below the "perf_event_alloc()",
but I didn't check very much.

The fact that create_local_trace_uprobe() can end up going into a
lookup of an OVL filesystem path smells kind of odd to me to begin
with, but I didn't look at the whole thing.

PeterZ, is there something I'm missing?

Linus