lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQL3njbb3ANFkDWYRC-EHqAqWSwYs4OSUeKiw4XOYa+UNQ@mail.gmail.com>
Date: Thu, 6 Nov 2025 09:15:39 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
Cc: bpf <bpf@...r.kernel.org>, 
	"open list:KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>, LKML <linux-kernel@...r.kernel.org>, 
	Hari Bathini <hbathini@...ux.ibm.com>, sachinpb@...ux.ibm.com, 
	Venkat Rao Bagalkote <venkat88@...ux.ibm.com>, Andrii Nakryiko <andrii@...nel.org>, Eduard <eddyz87@...il.com>, 
	Alexei Starovoitov <ast@...nel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	Martin KaFai Lau <martin.lau@...ux.dev>, Song Liu <song@...nel.org>, 
	Yonghong Song <yonghong.song@...ux.dev>, John Fastabend <john.fastabend@...il.com>, 
	KP Singh <kpsingh@...nel.org>, Stanislav Fomichev <sdf@...ichev.me>, Hao Luo <haoluo@...gle.com>, 
	Jiri Olsa <jolsa@...nel.org>, Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH bpf-next] selftests/bpf: Fix htab_update/reenter_update
 selftest failure

On Wed, Nov 5, 2025 at 9:26 PM Saket Kumar Bhaskar <skb99@...ux.ibm.com> wrote:
>
> Since commit 31158ad02ddb ("rqspinlock: Add deadlock detection and recovery")
> the updated path on re-entrancy now reports deadlock via
> -EDEADLK instead of the previous -EBUSY.
>
> The selftest is updated to align with expected errno
> with the kernel’s current behavior.
>
> Signed-off-by: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
> ---
>  tools/testing/selftests/bpf/prog_tests/htab_update.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/htab_update.c b/tools/testing/selftests/bpf/prog_tests/htab_update.c
> index 2bc85f4814f4..98d52bb1446f 100644
> --- a/tools/testing/selftests/bpf/prog_tests/htab_update.c
> +++ b/tools/testing/selftests/bpf/prog_tests/htab_update.c
> @@ -40,7 +40,7 @@ static void test_reenter_update(void)
>         if (!ASSERT_OK(err, "add element"))
>                 goto out;
>
> -       ASSERT_EQ(skel->bss->update_err, -EBUSY, "no reentrancy");
> +       ASSERT_EQ(skel->bss->update_err, -EDEADLK, "no reentrancy");

Makes sense, but looks like the test was broken for quite some time.
It fails with
        /* lookup_elem_raw() may be inlined and find_kernel_btf_id()
will return -ESRCH */
        bpf_program__set_autoload(skel->progs.lookup_elem_raw, true);
        err = htab_update__load(skel);
        if (!ASSERT_TRUE(!err || err == -ESRCH, "htab_update__load") || err)

before reaching deadlk check.
Pls make it more robust.
__pcpu_freelist_pop() might be better alternative then lookup_elem_raw().

pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ