From: Alan Maguire <alan.maguire@oracle.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
andrii@kernel.org, eddyz87@gmail.com, qmo@kernel.org
Cc: jolsa@kernel.org, daniel@iogearbox.net, ihor.solodrai@linux.dev,
yonghong.song@linux.dev, song@kernel.org, martin.lau@linux.dev,
memxor@gmail.com, emil@etsalapatis.com, bpf@vger.kernel.org,
nsc@kernel.org, puranjay@kernel.org, yatsenko@meta.com
Subject: Re: [PATCH v3 bpf-next 1/3] bpf: Verify BTF_KIND_LOC_PARAM vlen, flags
Date: Tue, 29 Sep 2026 11:50:46 +0100 [thread overview]
Message-ID: <06e079bb-8e00-453e-8df2-47539758bdcb@oracle.com> (raw)
In-Reply-To: <DLRQL3VZ2FRD.2JRCFNKOLT1P8@gmail.com>
On 29/09/2026 11:43, Alexei Starovoitov wrote:
> On Sat, Sep 26, 2026 at 06:51 PM Alan Maguire <alan.maguire@oracle.com> wrote:
>> + case BTF_LOC_PARAM_CONST | BTF_LOC_PARAM_ADDR | BTF_LOC_PARAM_SIGNED:
>> + if (vlen > 2)
>> + goto invalid_vlen;
>> + /* Ensure size/vlen are consistent */
>> + if (size > sizeof(__u32) && vlen != 2)
>> + goto invalid_vlen;
>> + if (size > sizeof(__u64))
>> + goto invalid_vlen;
>> + break;
>
> size <= 4 with vlen == 2 is still accepted.
> For size=4 values={1, 2} bpftool prints 'const 0x200000001'
> and 'const 0x1' when SIGNED is set.
> pahole emits one word for size <= 4 and two otherwise.
> Should it be
> if (vlen != (size > 4 ? 2 : 1))
> ?
>
> Applied anyway, but pls followup.
>
good catch, will do. thanks!
next prev parent reply other threads:[~2026-09-29 10:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-26 17:51 [PATCH v3 bpf-next 0/3] BTF inline functionality followups Alan Maguire
2026-09-26 17:51 ` [PATCH v3 bpf-next 1/3] bpf: Verify BTF_KIND_LOC_PARAM vlen, flags Alan Maguire
2026-09-29 10:43 ` Alexei Starovoitov
2026-09-29 10:50 ` Alan Maguire [this message]
2026-09-26 17:51 ` [PATCH v3 bpf-next 2/3] bpftool: Update func representation to include function signature Alan Maguire
2026-09-28 9:39 ` Jiri Olsa
2026-09-28 9:50 ` Alan Maguire
2026-09-28 11:46 ` Quentin Monnet
2026-09-26 17:51 ` [PATCH v3 bpf-next 3/3] selftests/bpf: Fix up bpftool btf dump test for signatures Alan Maguire
2026-09-28 9:39 ` [PATCH v3 bpf-next 0/3] BTF inline functionality followups Jiri Olsa
2026-09-28 11:46 ` Quentin Monnet
2026-09-29 10:50 ` 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=06e079bb-8e00-453e-8df2-47539758bdcb@oracle.com \
--to=alan.maguire@oracle.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=nsc@kernel.org \
--cc=puranjay@kernel.org \
--cc=qmo@kernel.org \
--cc=song@kernel.org \
--cc=yatsenko@meta.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.