[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4Bzbp-LxpFR5Ue6YTfana5ST+sHMLi_zxS9Ax3uR7bXpuNA@mail.gmail.com>
Date: Tue, 22 Oct 2024 10:33:37 -0700
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Jiri Olsa <olsajiri@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>, andrii@...nel.org, yhs@...com,
linux-kernel@...r.kernel.org, daniel@...earbox.net, sean@...s.org,
bpf <bpf@...r.kernel.org>
Subject: Re: perf_event_detach_bpf_prog() broken?
+ bpf ML
On Tue, Oct 22, 2024 at 7:03 AM Jiri Olsa <olsajiri@...il.com> wrote:
>
> On Tue, Oct 22, 2024 at 01:16:38PM +0200, Peter Zijlstra wrote:
> > Hi guys,
> >
> > Per commit 170a7e3ea070 ("bpf: bpf_prog_array_copy() should return
> > -ENOENT if exclude_prog not found") perf_event_detach_bpf_prog() can now
> > return without doing bpf_prog_put() and leaving event->prog set.
> >
> > This is very 'unexpected' behaviour.
> >
> > I'm not sure what's sane from the BPF side of things here, but leaving
> > event->prog set is really rather unexpected.
> >
> > Help?
>
> IIUC the ENOENT should never happen in perf event context, so not
yep, if it does return an error it's a bug, right? So we can add
WARN_ONCE() or just drop the check, probably.
> sure why we have that check.. also does not seem to be used from
> lirc code, Sean?
>
> perf_event_detach_bpf_prog is called when the event is being freed
> so I think we should always put and clear the event->prog
>
> jirka
Powered by blists - more mailing lists