public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Eduard Zingerman <eddyz87@gmail.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>, Stanislav Fomichev <sdf@fomichev.me>,
	Thomas Gleixner <tglx@linutronix.de>,
	Yonghong Song <yonghong.song@linux.dev>
Subject: Re: [PATCH v2 bpf-next 3/3] bpf: Implement bpf_check_basics_ok() as a macro.
Date: Wed, 3 Jul 2024 14:39:27 +0200	[thread overview]
Message-ID: <20240703123927.Xm5AYkQd@linutronix.de> (raw)
In-Reply-To: <CAEf4BzYs1bXC1S+nnFLngb03=rcpiCz4-k_Ge=+OvJt9rR5OaA@mail.gmail.com>

On 2024-07-02 15:26:38 [-0700], Andrii Nakryiko wrote:
> 
> Why not open-code part of it and then have a function for checking length limit:
> 
> if (!filter)
>     return <error>;
> if (!bpf_check_prog_len(flen))
>     return <another-error>;
> 
> It's all local to a single file, no big deal adding a few if
> (!pointer) checks explicitly, IMO. "basics" is super generic and not a
> great name either way.

Okay.

Sebastian

      reply	other threads:[~2024-07-03 12:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02 14:21 [PATCH v2 bpf-next 0/3] bpf: sparse cleanup Sebastian Andrzej Siewior
2024-07-02 14:21 ` [PATCH v2 bpf-next 1/3] bpf: Add casts to keep sparse quiet Sebastian Andrzej Siewior
2024-07-03 21:39   ` Alexei Starovoitov
2024-07-04  8:00     ` Sebastian Andrzej Siewior
2024-07-07  0:42       ` Alexei Starovoitov
2024-07-02 14:21 ` [PATCH v2 bpf-next 2/3] bpf: Move a few bpf_func_proto declarations Sebastian Andrzej Siewior
2024-07-02 22:30   ` Andrii Nakryiko
2024-07-02 14:21 ` [PATCH v2 bpf-next 3/3] bpf: Implement bpf_check_basics_ok() as a macro Sebastian Andrzej Siewior
2024-07-02 16:27   ` Jiri Olsa
2024-07-02 18:12     ` Sebastian Andrzej Siewior
2024-07-02 22:26   ` Andrii Nakryiko
2024-07-03 12:39     ` Sebastian Andrzej Siewior [this message]

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=20240703123927.Xm5AYkQd@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=tglx@linutronix.de \
    --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