BPF List
 help / color / mirror / Atom feed
From: Anton Protopopov <a.s.protopopov@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v1 bpf-next 16/18] selftests/bpf: Test fmod_ret candidates found by bpf_scan_ir
Date: Mon, 9 Nov 2026 14:09:42 +0000	[thread overview]
Message-ID: <avHUJhNSgifusdtc@mail.gmail.com> (raw)
In-Reply-To: <sashiko-outbox-202287@kernel.org>

On 26/11/06 09:09PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] selftests/bpf: missing KASAN and KCSAN exclusions for
>   bpf_testmod_retval.o
> --
> 
> commit 628c6eb28eaac0eeb5e557c0b787a65b02cd6e06
> Author: Anton Protopopov <a.s.protopopov@gmail.com>
> 
> selftests/bpf: Test fmod_ret candidates found by bpf_scan_ir
> 
> This commit adds bpf_testmod fixtures and BPF selftests to verify the
> fmod_ret target tags generated by the bpf_scan_ir compiler plugin and the
> verifier's enforcement of restricted return values.
> 
> > diff --git a/tools/testing/selftests/bpf/test_kmods/Makefile b/tools/testing/selftests/bpf/test_kmods/Makefile
> > index 031c7454ce65f..475df9a7680ea 100644
> > --- a/tools/testing/selftests/bpf/test_kmods/Makefile
> > +++ b/tools/testing/selftests/bpf/test_kmods/Makefile
> > @@ -23,7 +23,16 @@ MODULES = bpf_testmod.ko bpf_test_no_cfi.ko bpf_test_modorder_x.ko \
> >  
> >  $(foreach m,$(MODULES),$(eval obj-m += $(m:.ko=.o)))
> >  
> > -CFLAGS_bpf_testmod.o = -I$(src)
> > +bpf_testmod-y := bpf_testmod_main.o
> > +# The functions for bpf_scan_ir use clang extensions and need the plugin
> > +bpf_testmod-$(CONFIG_CLANG_PLUGIN_BPF_SCAN_IR) += bpf_testmod_retval.o \
> > +						  bpf_testmod_retval_strong.o
> > +# Coverage instrumentation makes every path of the fixtures dirty
> > +GCOV_PROFILE_bpf_testmod_retval.o := n
> > +KCOV_INSTRUMENT_bpf_testmod_retval.o := n
> > +KMSAN_SANITIZE_bpf_testmod_retval.o := n
> 
> [Severity: Low]
> Should KASAN_SANITIZE_bpf_testmod_retval.o and
> KCSAN_SANITIZE_bpf_testmod_retval.o also be set to n here?
> 
> bpf_testmod_retval_private_store() and bpf_testmod_retval_private_memset()
> use __attribute__((optnone)) to keep their stack writes and memset in the
> IR until OptimizerLast.  When CONFIG_KASAN or CONFIG_KCSAN is enabled, the
> sanitizer pass runs before bpf_scan_ir and instruments those operations
> with shadow stores and runtime calls (__asan_report_store4, __asan_memset,
> __tsan_write4), which bpf_scan_ir rejects as side effects, causing the tags
> subtest in test_fmodret_retval() to fail.

Added KCSAN and UBSAN (just in case, neither is enabled in tests).

> Sashiko AI review · https://sashiko.dev/#/patchset/20261106205523.1765622-1-a.s.protopopov@gmail.com?part=16

  reply	other threads:[~2026-11-09 13:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 21:02 [PATCH v1 bpf-next 01/18] bpf: Add BTF ID sets for fmod_ret targets Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 02/18] bpf: Add a btf_id_set8_entry helper Anton Protopopov
2026-11-06 20:58   ` sashiko-bot
2026-11-09 13:02     ` Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 03/18] bpf: Build fmod_ret target sets from BTF decl tags Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 04/18] selftests/bpf: Declare bpf_fentry_test1 in tracing tests Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 05/18] bpf: Declare fmod_ret targets with BTF_FMODRET sets Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 06/18] selftests/bpf: Test fmod_ret BTF decl tags and attach permission Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 07/18] scripts: Add LLVM plugin infrastructure Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 08/18] bpf: Add the bpf_scan_ir LLVM plugin Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 09/18] bpf: Find fmod_ret candidates in bpf_scan_ir Anton Protopopov
2026-11-06 21:02 ` [PATCH v1 bpf-next 10/18] bpf: Allow writes to private stack objects " Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 11/18] bpf: Follow PHIs " Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 12/18] bpf: Follow integer casts " Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 13/18] bpf: Check the return values of fmod_ret programs on found targets Anton Protopopov
2026-11-06 21:17   ` sashiko-bot
2026-11-09 13:14     ` Anton Protopopov
2026-11-09 13:16       ` Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 14/18] bpf: Require the JIT for fmod_ret programs on found 64-bit targets Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 15/18] resolve_btfids: Tag fmod_ret candidates as targets Anton Protopopov
2026-11-06 21:14   ` sashiko-bot
2026-11-09 13:26     ` Anton Protopopov
2026-11-06 21:50   ` bot+bpf-ci
2026-11-09 13:33     ` Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 16/18] selftests/bpf: Test fmod_ret candidates found by bpf_scan_ir Anton Protopopov
2026-11-06 21:09   ` sashiko-bot
2026-11-09 14:09     ` Anton Protopopov [this message]
2026-11-06 21:50   ` bot+bpf-ci
2026-11-09 13:59     ` Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 17/18] selftests/bpf: Enable bpf_scan_ir in the config Anton Protopopov
2026-11-06 21:35   ` bot+bpf-ci
2026-11-09 13:45     ` Anton Protopopov
2026-11-06 21:03 ` [PATCH v1 bpf-next 18/18] bpftool: List and show fmod_ret targets Anton Protopopov
2026-11-06 21:35   ` bot+bpf-ci
2026-11-09 13:40     ` Anton Protopopov
2026-11-09 17:02 ` [PATCH v1 bpf-next 01/18] bpf: Add BTF ID sets for " Anton Protopopov

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=avHUJhNSgifusdtc@mail.gmail.com \
    --to=a.s.protopopov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=sashiko-reviews@lists.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