[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220729154357.12cfea5f@rorschach.local.home>
Date: Fri, 29 Jul 2022 15:43:57 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Song Liu <song@...nel.org>
Cc: <bpf@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<live-patching@...r.kernel.org>, <daniel@...earbox.net>,
<kernel-team@...com>, <jolsa@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>
Subject: Re: [PATCH bpf-next] bpf: fix test_progs -j error with fentry/fexit
tests
On Fri, 29 Jul 2022 12:41:06 -0700
Song Liu <song@...nel.org> wrote:
> Then multiple threads are attaching/detaching fentry/fexit programs to
"When multiple threads"?
-- Steve
> the same trampoline, we may call register_fentry on the same trampoline
> twice: register_fentry(), unregister_fentry(), then register_fentry again.
> This causes ftrace_set_filter_ip() for the same ip on tr->fops twice,
> which leaves duplicated ip in tr->fops. The extra ip is not cleaned up
> properly on unregister and thus causes failures with further register in
> register_ftrace_direct_multi():
>
> register_ftrace_direct_multi()
> {
> ...
> for (i = 0; i < size; i++) {
> hlist_for_each_entry(entry, &hash->buckets[i], hlist) {
> if (ftrace_find_rec_direct(entry->ip))
> goto out_unlock;
> }
> }
> ...
> }
>
> This can be triggered with parallel fentry/fexit tests with test_progs:
>
> ./test_progs -t fentry,fexit -j
>
> Fix this by resetting tr->fops in ftrace_set_filter_ip(), so that there
> will never be duplicated entries in tr->fops.
>
Powered by blists - more mailing lists