From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
bpf@vger.kernel.org, Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: [PATCH bpf-next 9/9] selftests/bpf: Add MSan annotations
Date: Thu, 09 Feb 2023 11:30:36 +0100 [thread overview]
Message-ID: <7c815a4c0b65bb723e6afbf828fb478ceb5576eb.camel@linux.ibm.com> (raw)
In-Reply-To: <CAEf4BzYMa5SXLu8Ajy7DjyJ3-qvK=AN5w+9YNwxrrQyjsNPk+g@mail.gmail.com>
On Wed, 2023-02-08 at 17:34 -0800, Andrii Nakryiko wrote:
> On Wed, Feb 8, 2023 at 12:57 PM Ilya Leoshkevich <iii@linux.ibm.com>
> wrote:
> >
> > eBPF selftests produce a few false positives with MSan. These can
> > be
> > divided in two classes:
> >
> > - Sending uninitalized data via a socket.
> > - bpf_obj_get_info_by_fd() calls.
> >
> > The first class is trivial; the second should ideally be handled by
> > libbpf, but it doesn't look possible at the moment, since we don't
> > know the type of the eBPF object referred to by fd, and therefore
> > the
> > structure of the output data.
>
> yeah, bpf_obj_get_info_by_fd() is quite bad from usability
> standpoint.
> I think we should add bpf_get_{map,prog,link,btf}_info_by_fd()
> wrappers and try to use them. That will allow to specify correct
> expected struct types, we'll be able to mark initialized memory
> properly. We already have bpf_{map,prog,btf,link}_get_fd_by_id()
> family, so having similar for getting info seems fitting (even if
> underlying bpf() command is generic).
>
> Thoughts?
Sounds good to me, I will give it a try.
> >
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > ---
> > tools/testing/selftests/bpf/cap_helpers.c | 3 +++
> > tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c | 10
> > ++++++++++
> > tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c | 3 +++
> > tools/testing/selftests/bpf/prog_tests/btf.c | 11
> > +++++++++++
> > tools/testing/selftests/bpf/prog_tests/send_signal.c | 2 ++
> > .../selftests/bpf/prog_tests/tp_attach_query.c | 6 ++++++
> > tools/testing/selftests/bpf/prog_tests/xdp_bonding.c | 3 +++
> > tools/testing/selftests/bpf/xdp_synproxy.c | 2 ++
> > 8 files changed, 40 insertions(+)
> >
>
> [...]
prev parent reply other threads:[~2023-02-09 10:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 20:56 [PATCH bpf-next 0/9] selftests/bpf: Add Memory Sanitizer support Ilya Leoshkevich
2023-02-08 20:56 ` [PATCH bpf-next 1/9] selftests/bpf: Quote host tools Ilya Leoshkevich
2023-02-08 20:56 ` [PATCH bpf-next 2/9] tools: runqslower: Add EXTRA_CFLAGS and EXTRA_LDFLAGS support Ilya Leoshkevich
2023-02-09 1:00 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 3/9] selftests/bpf: Split SAN_CFLAGS and SAN_LDFLAGS Ilya Leoshkevich
2023-02-08 20:56 ` [PATCH bpf-next 4/9] selftests/bpf: Forward SAN_CFLAGS and SAN_LDFLAGS to runqslower and libbpf Ilya Leoshkevich
2023-02-09 1:03 ` Andrii Nakryiko
2023-02-09 9:55 ` Ilya Leoshkevich
2023-02-09 17:17 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 5/9] selftests/bpf: Attach to fopen()/fclose() in uprobe_autoattach Ilya Leoshkevich
2023-02-09 1:05 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 6/9] selftests/bpf: Attach to fopen()/fclose() in attach_probe Ilya Leoshkevich
2023-02-09 1:06 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 7/9] libbpf: Fix alen calculation in libbpf_nla_dump_errormsg() Ilya Leoshkevich
2023-02-09 1:14 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 8/9] libbpf: Add MSan annotations Ilya Leoshkevich
2023-02-09 1:29 ` Andrii Nakryiko
2023-02-09 10:01 ` Ilya Leoshkevich
2023-02-09 19:37 ` Andrii Nakryiko
2023-02-08 20:56 ` [PATCH bpf-next 9/9] selftests/bpf: " Ilya Leoshkevich
2023-02-09 1:34 ` Andrii Nakryiko
2023-02-09 10:30 ` Ilya Leoshkevich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7c815a4c0b65bb723e6afbf828fb478ceb5576eb.camel@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox