public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: andrii@kernel.org, ast@kernel.org, daniel@iogearbox.net,
	martin.lau@linux.dev, eddyz87@gmail.com, memxor@gmail.com,
	song@kernel.org, yonghong.song@linux.dev, bpf@vger.kernel.org
Subject: Re: [PATCH v3 bpf-next 0/2] selftests/bpf: Test BTF sanitization
Date: Fri, 10 Apr 2026 18:05:27 +0200	[thread overview]
Message-ID: <adkfx0imgJ2mjtHM@krava> (raw)
In-Reply-To: <20260408165735.843763-1-alan.maguire@oracle.com>

On Wed, Apr 08, 2026 at 05:57:33PM +0100, Alan Maguire wrote:
> Allow simulation of missing BPF features through provision of
> a synthetic feature cache set, and use this to simulate case
> where FEAT_BTF_LAYOUT is missing.  Ensure sanitization leaves us
> with expected BTF (layout info removed, layout header fields
> zeroed, strings data adjusted).
> 
> Specifying a feature cache with selected missing features will
> allow testing of other missing feature codepaths, but for now
> add BTF layout sanitization test only.
> 
> Changes since v2 [1]:
> 
> - change zfree() to free() since we immediately assign the
>   feat_cache (Jiri, patch 1)
> - "goto out" to avoid skeleton leak (Chengkaitao, patch 2)
> - just use kfree_skb__open() since we do not need to load
>   skeleton

Acked-by: Jiri Olsa <jolsa@kernel.org>

jirka

> 
> Changes since v1 [2]:
> 
> - renamed to bpf_object_set_feat_cache() (Andrii, patch 1)
> - remove __packed, relocate skeleton open/load, fix formatting
>   issues (Andrii, patch 2)
> 
> [1] https://lore.kernel.org/bpf/20260408105324.663280-1-alan.maguire@oracle.com/
> [2] https://lore.kernel.org/bpf/20260401164302.3844142-1-alan.maguire@oracle.com/
> 
> Alan Maguire (2):
>   libbpf: Allow use of feature cache for non-token cases
>   selftests/bpf: Add BTF sanitize test covering BTF layout
> 
>  tools/lib/bpf/libbpf.c                        | 12 ++-
>  tools/lib/bpf/libbpf_internal.h               |  3 +-
>  .../selftests/bpf/prog_tests/btf_sanitize.c   | 97 +++++++++++++++++++
>  3 files changed, 109 insertions(+), 3 deletions(-)
>  create mode 100644 tools/testing/selftests/bpf/prog_tests/btf_sanitize.c
> 
> -- 
> 2.39.3
> 

  parent reply	other threads:[~2026-04-10 16:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 16:57 [PATCH v3 bpf-next 0/2] selftests/bpf: Test BTF sanitization Alan Maguire
2026-04-08 16:57 ` [PATCH v3 bpf-next 1/2] libbpf: Allow use of feature cache for non-token cases Alan Maguire
2026-04-08 16:57 ` [PATCH v3 bpf-next 2/2] selftests/bpf: Add BTF sanitize test covering BTF layout Alan Maguire
2026-04-10 16:05 ` Jiri Olsa [this message]
2026-04-10 19:40 ` [PATCH v3 bpf-next 0/2] selftests/bpf: Test BTF sanitization patchwork-bot+netdevbpf

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=adkfx0imgJ2mjtHM@krava \
    --to=olsajiri@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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