public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: kernel test robot <lkp@intel.com>, io-uring@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, bpf@vger.kernel.org,
	axboe@kernel.dk,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subject: Re: [PATCH v7 2/5] io_uring/bpf-ops: implement loop_step with BPF struct_ops
Date: Tue, 17 Feb 2026 11:05:10 +0000	[thread overview]
Message-ID: <47684e50-d7c6-4f20-9206-366c9c343eb3@gmail.com> (raw)
In-Reply-To: <202602171315.iJKYSSFe-lkp@intel.com>

On 2/17/26 05:24, kernel test robot wrote:
> io_uring/bpf-ops.c:45 bpf_io_btf_struct_access() warn: always true condition '(off >= $expr_0x7fb415932650(30)) => (s32min-s32max >= 0)'

Got me confused at first, but it's the first field => offsetof() == 0,
and after type promotions it compares an unsigned type with 0.

I think smatch is too strict, and it's better the current way,
i.e. handling all fileds in the same way, but I'll respin to
silence smatch.

> 
> vim +45 io_uring/bpf-ops.c
> 
>      37	
>      38	static int bpf_io_btf_struct_access(struct bpf_verifier_log *log,
>      39					    const struct bpf_reg_state *reg, int off,
>      40					    int size)
>      41	{
>      42		const struct btf_type *t = btf_type_by_id(reg->btf, reg->btf_id);
>      43	
>      44		if (t == loop_params_type) {
>    > 45			if (off >= offsetof(struct iou_loop_params, cq_wait_idx) &&
>      46			    off + size <= offsetofend(struct iou_loop_params, cq_wait_idx))
>      47				return SCALAR_VALUE;
>      48		}
>      49	
>      50		return -EACCES;
>      51	}
>      52	
> 

-- 
Pavel Begunkov


  reply	other threads:[~2026-02-17 11:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-16 16:51 [PATCH v7 0/5] BPF controlled io_uring Pavel Begunkov
2026-02-16 16:51 ` [PATCH v7 1/5] io_uring: introduce callback driven main loop Pavel Begunkov
2026-02-16 16:51 ` [PATCH v7 2/5] io_uring/bpf-ops: implement loop_step with BPF struct_ops Pavel Begunkov
2026-02-17  5:24   ` kernel test robot
2026-02-17 11:05     ` Pavel Begunkov [this message]
2026-02-16 16:51 ` [PATCH v7 3/5] io_uring/bpf-ops: add kfunc helpers Pavel Begunkov
2026-02-16 16:51 ` [PATCH v7 4/5] io_uring/bpf-ops: implement bpf ops registration Pavel Begunkov
2026-02-16 16:51 ` [PATCH v7 5/5] selftests/io_uring: add a bpf io_uring selftest Pavel Begunkov

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=47684e50-d7c6-4f20-9206-366c9c343eb3@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bpf@vger.kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@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