From: Ian Denhardt <ian@zenhack.net>
To: ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org,
netdev@vger.kernel.org
Subject: More strict error checking in bpf_asm?
Date: Tue, 23 Feb 2021 15:26:37 -0500 [thread overview]
Message-ID: <161411199784.11959.16534412799839825563@localhost.localdomain> (raw)
Hi,
I'm using the `bpf_asm` tool to do some syscall filtering, and found out
the hard way that its error checking isn't very strict. In particular,
it issues a warning (not an error) when a jump offset overflows the
instruction's field. It really seems like this *ought* to be a hard
error, but I see from the commit message in
7e22077d0c73a68ff3fd8b3d2f6564fcbcf8cb23 that this was left as a warning
due to backwards compatibility concerns.
I'm skeptical of this trade-off, but would people at least be open to
adding a -Werror flag or the like, if changing it to a hard error
unconditionally is off the table?
Relatedly, while looking through the code I noticed there are several
places where an error occurs that does cause to tool to exit without
generating code, but it exits with 0 (success) status code. It seems
like this ought to report a failure to the caller?
-Ian
next reply other threads:[~2021-02-23 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 20:26 Ian Denhardt [this message]
2021-02-23 20:47 ` More strict error checking in bpf_asm? Ilya Leoshkevich
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=161411199784.11959.16534412799839825563@localhost.localdomain \
--to=ian@zenhack.net \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).