[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAADnVQLqYyNhPuM6oFg_vp2ETvad06qS6u9_AiA+2DzVDku8yg@mail.gmail.com>
Date: Wed, 29 Sep 2021 13:26:49 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Song Liu <songliubraving@...com>
Cc: Kumar Kartikeya Dwivedi <memxor@...il.com>,
bpf <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>, Martin Lau <kafai@...com>,
Yonghong Song <yhs@...com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Toke Høiland-Jørgensen <toke@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH bpf-next v5 11/12] bpf: selftests: Fix fd cleanup in get_branch_snapshot
On Tue, Sep 28, 2021 at 4:58 PM Song Liu <songliubraving@...com> wrote:
>
>
>
> > On Sep 27, 2021, at 7:59 AM, Kumar Kartikeya Dwivedi <memxor@...il.com> wrote:
> >
> > Cleanup code uses while (cpu++ < cpu_cnt) for closing fds, which means
> > it starts iterating from 1 for closing fds. If the first fd is -1, it
> > skips over it and closes garbage fds (typically zero) in the remaining
> > array. This leads to test failures for future tests when they end up
> > storing fd 0 (as the slot becomes free due to close(0)) in ldimm64's BTF
> > fd, ending up trying to match module BTF id with vmlinux.
> >
> > This was observed as spurious CI failure for the ksym_module_libbpf and
> > module_attach tests. The test ends up closing fd 0 and breaking libbpf's
> > assumption that module BTF fd will always be > 0, which leads to the
> > kernel thinking that we are pointing to a BTF ID in vmlinux BTF.
> >
> > Cc: Song Liu <songliubraving@...com>
> > Fixes: 025bd7c753aa (selftests/bpf: Add test for bpf_get_branch_snapshot)
> > Signed-off-by: Kumar Kartikeya Dwivedi <memxor@...il.com>
>
> Thanks for the fix!
>
> Acked-by: Song Liu <songliubraving@...com>
Applied this fix to bpf-next.
Powered by blists - more mailing lists