Re: [PATCH 0/2] More strict error checking in bpf_asm (v3).

2021-02-26 Thread Ian Denhardt
Quoting Daniel Borkmann (2021-02-26 17:00:58) > Applied, thanks! You're welcome!

[PATCH 2/2] tools, bpf_asm: exit non-zero on errors.

2021-02-24 Thread Ian Denhardt
...so callers can correctly detect failure. Signed-off-by: Ian Denhardt --- tools/bpf/bpf_exp.y | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bpf/bpf_exp.y b/tools/bpf/bpf_exp.y index 8d03e5245da5..dfb7254a24e8 100644 --- a/tools/bpf/bpf_exp.y +++ b/tools/bpf

[PATCH 1/2] tools, bpf_asm: Hard error on out of range jumps.

2021-02-24 Thread Ian Denhardt
were only speculation. Signed-off-by: Ian Denhardt Acked-by: Ilya Leoshkevich --- tools/bpf/bpf_exp.y | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpf_exp.y b/tools/bpf/bpf_exp.y index 8d48e896be50..8d03e5245da5 100644 --- a/tools/bpf/bpf_exp.y +++ b/tools

[PATCH 0/2] More strict error checking in bpf_asm (v3).

2021-02-24 Thread Ian Denhardt
Gah, managed to typo my own name in the v2 patch >.< This one should be good :/ Ian Denhardt (2): tools, bpf_asm: Hard error on out of range jumps. tools, bpf_asm: exit non-zero on errors. tools/bpf/bpf_exp.y | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.30.1

[PATCH 2/2] tools, bpf_asm: exit non-zero on errors.

2021-02-24 Thread Ian Denhardt
...so callers can correctly detect failure. Signed-off-by: Ian Denhardt --- tools/bpf/bpf_exp.y | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bpf/bpf_exp.y b/tools/bpf/bpf_exp.y index 8d03e5245da5..dfb7254a24e8 100644 --- a/tools/bpf/bpf_exp.y +++ b/tools/bpf

[PATCH 0/2] More strict error checking in bpf_asm (v2).

2021-02-24 Thread Ian Denhardt
Second pass at the patches from: https://lore.kernel.org/bpf/ef747c45-a68c-2a87-202c-5fd9faf70...@iogearbox.net/T/#t. Patches are the same, this just addes the Signed-off-by: lines as requested by Daniel Borkmann Ian Denhardt (2): tools, bpf_asm: Hard error on out of range jumps. tools

[PATCH 1/2] tools, bpf_asm: Hard error on out of range jumps.

2021-02-24 Thread Ian Denhardt
Per discussion at: https://lore.kernel.org/bpf/c964892195a6b91d20a67691448567ef528ffa6d.ca...@linux.ibm.com/T/#t ...this was originally introduced as a warning due to concerns about breaking existing code, but a hard error probably makes more sense, especially given that concerns about breakage w

[PATCH 2/2] tools, bpf_asm: exit non-zero on errors.

2021-02-23 Thread Ian Denhardt
...so callers can correctly detect failure. --- tools/bpf/bpf_exp.y | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bpf/bpf_exp.y b/tools/bpf/bpf_exp.y index 8d03e5245da5..dfb7254a24e8 100644 --- a/tools/bpf/bpf_exp.y +++ b/tools/bpf/bpf_exp.y @@ -185,13 +185,13 @

[PATCH 1/2] tools, bpf_asm: Hard error on out of range jumps.

2021-02-23 Thread Ian Denhardt
Per discussion at: https://lore.kernel.org/bpf/c964892195a6b91d20a67691448567ef528ffa6d.ca...@linux.ibm.com/T/#t ...this was originally introduced as a warning due to concerns about breaking existing code, but a hard error probably makes more sense, especially given that concerns about breakage w

[PATCH 0/2] More strict error checking in bpf_asm.

2021-02-23 Thread Ian Denhardt
them together. -Ian Ian Denhardt (2): tools, bpf_asm: Hard error on out of range jumps. tools, bpf_asm: exit non-zero on errors. tools/bpf/bpf_exp.y | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) -- 2.30.1

More strict error checking in bpf_asm?

2021-02-23 Thread Ian Denhardt
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 s