BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: "Maciej Żenczykowski" <zenczykowski@gmail.com>
Cc: BPF Mailing List <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>
Subject: Re: Funky verifier packet range error (> check works, != does not).
Date: Wed, 03 Jan 2024 01:13:57 +0200	[thread overview]
Message-ID: <4e28b260c469164846abc26c1487f565fea98f67.camel@gmail.com> (raw)
In-Reply-To: <CAHo-OoxanNo=0ppvq940KaUZBMBWjLyMgWCXCMfmyhMR6pmC2g@mail.gmail.com>

On Tue, 2024-01-02 at 12:36 -0800, Maciej Żenczykowski wrote:
[...]
> 
> I wonder if JEQ/JNE couldn't simply be folded into the existing cases though...
> Or perhaps some other refactoring to tri-state the jmps...
> 
> switch (opcode) {
> case BPF_JEQ: eq_branch = this_branch; lt_branch = gt_branch =
> other_branch; break;
> case BPF_JNE: lt_branch = gt_branch = this_branch; eq_branch =
> other_branch; break;
> case BPF_LT: lt_branch = this_branch; eq_branch = gt_branch =
> other_branch; break;
> ...
> }
> and then you can ignore opcode...

The code could probably be simplified a bit (actually, I'm thinking
about pulling all dst/src type checks as bool variables at the beginning).

Suppose Andrii accepts this change, would you want to submit the patch?
(or I can wrap-up what I have).


  reply	other threads:[~2024-01-02 23:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-30  1:31 Funky verifier packet range error (> check works, != does not) Maciej Żenczykowski
2024-01-02 16:39 ` Eduard Zingerman
2024-01-02 18:30   ` Maciej Żenczykowski
2024-01-02 19:23     ` Eduard Zingerman
2024-01-02 20:36       ` Maciej Żenczykowski
2024-01-02 23:13         ` Eduard Zingerman [this message]
2024-01-04 16:41           ` Eduard Zingerman
2024-01-05  0:33             ` Maciej Żenczykowski
2024-01-02 21:45 ` Andrii Nakryiko
2024-01-02 22:45   ` Maciej Żenczykowski
2024-01-02 23:56     ` Yonghong Song
2024-01-03  0:06     ` Andrii Nakryiko
2024-01-03  0:29       ` Eduard Zingerman

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=4e28b260c469164846abc26c1487f565fea98f67.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=zenczykowski@gmail.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