From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Eduard Zingerman <eddyz87@gmail.com>,
Mykyta Yatsenko <yatsenko@meta.com>, Tejun Heo <tj@kernel.org>,
Alan Maguire <alan.maguire@oracle.com>,
Benjamin Tissoires <bentiss@kernel.org>,
Jiri Kosina <jikos@kernel.org>, Amery Hung <ameryhung@gmail.com>,
bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
"open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
sched-ext@lists.linux.dev
Subject: Re: [PATCH bpf-next v3 03/13] bpf: Verifier support for KF_IMPLICIT_ARGS
Date: Tue, 20 Jan 2026 16:35:26 -0800 [thread overview]
Message-ID: <1dc18b13-af48-47d4-afdc-35b31410eea8@linux.dev> (raw)
In-Reply-To: <CAADnVQKtN9HS7sWE_fZex4hT=ZEGDQX+C7tS6jc2+8ixC+Jexw@mail.gmail.com>
On 1/20/26 4:30 PM, Alexei Starovoitov wrote:
> On Tue, Jan 20, 2026 at 2:27 PM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>
>> Introduction of KF_IMPLICIT_ARGS revealed an issue with zero-extension
>> tracking, because an explicit rX = 0 in place of the verifier-supplied
>> argument is now absent if the arg is implicit (the BPF prog doesn't
>> pass a dummy NULL anymore). To mitigate this, reset the subreg_def of
>> all caller saved registers in check_kfunc_call() [1].
>>
>> [1] https://lore.kernel.org/bpf/b4a760ef828d40dac7ea6074d39452bb0dc82caa.camel@gmail.com/
>
> ...
>
>> - for (i = 0; i < CALLER_SAVED_REGS; i++)
>> - mark_reg_not_init(env, regs, caller_saved[i]);
>> + for (i = 0; i < CALLER_SAVED_REGS; i++) {
>> + u32 regno = caller_saved[i];
>> +
>> + mark_reg_not_init(env, regs, regno);
>> + regs[regno].subreg_def = DEF_NOT_SUBREG;
>> + }
>
> I'm reading that no follow up is necessary anymore and
> the new selftests cover this part automatically.
With respect to this series, the hunk above is good enough.
But we haven't tracked down why doing
.subreg_def = DEF_NOT_SUBREG
inside mark_reg_not_init() breaks zero-extension tracking.
May be a dormant bug somewhere.
next prev parent reply other threads:[~2026-01-21 0:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 22:26 [PATCH bpf-next v3 00/13] bpf: Kernel functions with KF_IMPLICIT_ARGS Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 01/13] bpf: Refactor btf_kfunc_id_set_contains Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 02/13] bpf: Introduce struct bpf_kfunc_meta Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 03/13] bpf: Verifier support for KF_IMPLICIT_ARGS Ihor Solodrai
2026-01-21 0:30 ` Alexei Starovoitov
2026-01-21 0:35 ` Ihor Solodrai [this message]
2026-01-20 22:26 ` [PATCH bpf-next v3 04/13] resolve_btfids: Introduce finalize_btf() step Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 05/13] resolve_btfids: Support for KF_IMPLICIT_ARGS Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 06/13] selftests/bpf: Add tests " Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 07/13] bpf: Migrate bpf_wq_set_callback_impl() to KF_IMPLICIT_ARGS Ihor Solodrai
2026-01-20 22:55 ` bot+bpf-ci
2026-01-20 23:04 ` Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 08/13] HID: Use bpf_wq_set_callback kernel function Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 09/13] bpf: Migrate bpf_task_work_schedule_* kfuncs to KF_IMPLICIT_ARGS Ihor Solodrai
2026-01-21 0:28 ` Alexei Starovoitov
2026-01-20 22:26 ` [PATCH bpf-next v3 10/13] bpf: Migrate bpf_stream_vprintk() " Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 11/13] selftests/bpf: Migrate struct_ops_assoc test " Ihor Solodrai
2026-01-20 22:26 ` [PATCH bpf-next v3 12/13] bpf: Remove __prog kfunc arg annotation Ihor Solodrai
2026-01-20 22:30 ` [PATCH bpf-next v3 13/13] bpf,docs: Document KF_IMPLICIT_ARGS flag Ihor Solodrai
2026-01-21 0:30 ` [PATCH bpf-next v3 00/13] bpf: Kernel functions with KF_IMPLICIT_ARGS 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=1dc18b13-af48-47d4-afdc-35b31410eea8@linux.dev \
--to=ihor.solodrai@linux.dev \
--cc=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bentiss@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=sched-ext@lists.linux.dev \
--cc=tj@kernel.org \
--cc=yatsenko@meta.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