[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wi4w9bPKFFGwLULjJf9hnkL941+c4HbeEVKNzqH04wqDA@mail.gmail.com>
Date: Wed, 17 May 2023 12:36:35 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Beau Belgrave <beaub@...ux.microsoft.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-trace-kernel@...r.kernel.org,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
David Vernet <void@...ifault.com>, dthaler@...rosoft.com,
brauner@...nel.org, hch@...radead.org
Subject: Re: [PATCH] tracing/user_events: Run BPF program if attached
On Wed, May 17, 2023 at 12:26 PM Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> Also note that this does NOT fix the incorrect RCU walks.
.. this is the patch that I think should go on top of it to fix the
misleading "safe" and the incorrect RCU walk.
NOTE! This adds that
lockdep_assert_held(&event_mutex);
to user_event_enabler_update() too. It's already there in
user_event_enabler_write(), but I'm not actually convinced this has
gotten enough coverage checking, so I also did it in that caller.
Some callers obviously hold that mutex. Others are much less obvious,
eg that user_event_reg() -> update_enable_bit_for() chain. I *assume*
all the 'class->reg()' callers get the event mutex, but I did not in
any way check that it is true.
So that lockdep annotation should be actually *tested* with lockdep
enabled and somebody doing all these operations.
Final note: I do not know this code *AT*ALL*. I'm literally just going
by "this is the only correct coding pattern to use", not by some
deeper understanding of what the code actually wants to do.
Linus
Powered by blists - more mailing lists