Immediate is incorrectly cast to u32 before being spilled, losing sign
information. The range information is incorrect after load again. Fix
immediate spill by remove the cast. The second patch add a test case
for this.
Signed-off-by: Hao Sun
---
Changes in v2:
- Add fix and cc tags.
- Link to v1
In check_stack_write_fixed_off(), imm value is cast to u32 before being
spilled to the stack. Therefore, the sign information is lost, and the
range information is incorrect when load from the stack again.
For the following prog:
0: r2 = r10
1: *(u64*)(r2 -40) = -44
2: r0 = *(u64*)(r2 - 40)
3: if
Add a test to check if the verifier correctly reason about the sign
of an immediate spilled to stack by BPF_ST instruction.
Signed-off-by: Hao Sun
---
tools/testing/selftests/bpf/verifier/bpf_st_mem.c | 32 +++
1 file changed, 32 insertions(+)
diff --git a/tools/testing/self
On Wed, Nov 01, 2023 at 08:33:22AM +0100, Hao Sun wrote:
> In check_stack_write_fixed_off(), imm value is cast to u32 before being
> spilled to the stack. Therefore, the sign information is lost, and the
> range information is incorrect when load from the stack again.
>
> For the following prog:
>
Let me add Richard to the CC list. See lore for more details.
https://lore.kernel.org/all/CA+G9fYuA643RHHpPnz9Ww7rr3zV5a0y=7_uFcybBSL=qp_s...@mail.gmail.com/
On Tue, Oct 31, 2023 at 09:57:48PM +0530, Naresh Kamboju wrote:
> On Mon, 30 Oct 2023 at 14:33, Dan Carpenter wrote:
> >
> > We have start
On Wed, 2023-11-01 at 08:33 +0100, Hao Sun wrote:
> In check_stack_write_fixed_off(), imm value is cast to u32 before being
> spilled to the stack. Therefore, the sign information is lost, and the
> range information is incorrect when load from the stack again.
>
> For the following prog:
> 0: r2
On Wed, 2023-11-01 at 08:33 +0100, Hao Sun wrote:
> Add a test to check if the verifier correctly reason about the sign
> of an immediate spilled to stack by BPF_ST instruction.
>
> Signed-off-by: Hao Sun
> ---
> tools/testing/selftests/bpf/verifier/bpf_st_mem.c | 32
> +++
>
On Wed, Nov 1, 2023 at 12:05 PM Eduard Zingerman wrote:
>
> On Wed, 2023-11-01 at 08:33 +0100, Hao Sun wrote:
> > Add a test to check if the verifier correctly reason about the sign
> > of an immediate spilled to stack by BPF_ST instruction.
> >
> > Signed-off-by: Hao Sun
> > ---
> > tools/testi
the test case
- Link to v2:
https://lore.kernel.org/r/20231101-fix-check-stack-write-v2-0-cb7c17b86...@gmail.com
Changes in v2:
- Add fix and cc tags.
- Link to v1:
https://lore.kernel.org/r/20231026-fix-check-stack-write-v1-0-6b325ef3c...@gmail.com
---
Hao Sun (2):
bpf: Fix
Add a test to check if the verifier correctly reason about the sign
of an immediate spilled to stack by BPF_ST instruction.
Signed-off-by: Hao Sun
---
tools/testing/selftests/bpf/verifier/bpf_st_mem.c | 32 +++
1 file changed, 32 insertions(+)
diff --git a/tools/testing/self
In check_stack_write_fixed_off(), imm value is cast to u32 before being
spilled to the stack. Therefore, the sign information is lost, and the
range information is incorrect when load from the stack again.
For the following prog:
0: r2 = r10
1: *(u64*)(r2 -40) = -44
2: r0 = *(u64*)(r2 - 40)
3: if
On Tue, Oct 31, 2023 at 05:11:59PM -0400, Willem de Bruijn wrote:
>
> The patch subject mentions UDP GSO, but the patch fixes the udpgro
> scripts.
>
> There are separate udpgso testcases. So you probably want to s/gso/gro.
>
The patch synchronizes the connection between the two binaries;
udpgso_
Hi Linus,
Please pull the following KUnit next update for Linux 6.7-rc1.
This kunit update for Linux 6.7-rc1 consists of:
-- string-stream testing enhancements
-- several fixes memory leaks
-- fix to reset status during parameter handling
diff is attached.
thanks,
-- Shuah
--
This patchset adds two kfunc helpers, bpf_xdp_get_xfrm_state() and
bpf_xdp_xfrm_state_release() that wrap xfrm_state_lookup() and
xfrm_state_put(). The intent is to support software RSS (via XDP) for
the ongoing/upcoming ipsec pcpu work [0]. Recent experiments performed
on (hopefully) reproducible
The ping6 binary went away over 7 years ago [0].
[0]:
https://github.com/iputils/iputils/commit/ebad35fee3de851b809c7b72ccc654a72b6af61d
Co-developed-by: Antony Antony
Signed-off-by: Antony Antony
Signed-off-by: Daniel Xu
---
tools/testing/selftests/bpf/test_tunnel.sh | 18 +-
Previously, if bpffs was not already mounted, then the test suite would
fail during object file pinning steps. Fix by mounting bpffs if
necessary.
Co-developed-by: Antony Antony
Signed-off-by: Antony Antony
Signed-off-by: Daniel Xu
---
tools/testing/selftests/bpf/test_tunnel.sh | 13 ++
vmlinux.h declarations are more ergnomic, especially when working with
kfuncs. The uapi headers are often incomplete for kfunc definitions.
Co-developed-by: Antony Antony
Signed-off-by: Antony Antony
Signed-off-by: Daniel Xu
---
.../selftests/bpf/progs/bpf_tracing_net.h | 1 +
.../selftes
Switching to vmlinux.h definitions seems to make the verifier very
unhappy with bitfield accesses. The error is:
; md.u.md2.dir = direction;
33: (69) r1 = *(u16 *)(r2 +11)
misaligned stack access off (0x0; 0x0)+-64+11 size 2
It looks like disabling CO-RE relocations seem to make the e
This commit extends test_tunnel selftest to test the new XDP xfrm state
lookup kfunc.
Co-developed-by: Antony Antony
Signed-off-by: Antony Antony
Signed-off-by: Daniel Xu
---
.../selftests/bpf/progs/test_tunnel_kern.c| 49 +++
tools/testing/selftests/bpf/test_tunnel.sh|
The pull request you sent on Wed, 1 Nov 2023 12:37:36 -0600:
> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
> tags/linux_kselftest-kunit-6.7-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5eda8f25377f3d6de697eaa1d9801b9781d09dbc
Thank you!
The pull request you sent on Wed, 1 Nov 2023 13:11:31 -0600:
> git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
> tags/linux_kselftest-next-6.7-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/7dc0e9c7dda66bd91eeada00d90033e3eb647fc3
Thank you!
Hello:
This series was applied to bpf/bpf.git (master)
by Alexei Starovoitov :
On Wed, 01 Nov 2023 13:33:50 +0100 you wrote:
> Immediate is incorrectly cast to u32 before being spilled, losing sign
> information. The range information is incorrect after load again. Fix
> immediate spill by remove
Hello:
This series was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov :
On Sat, 28 Oct 2023 10:54:13 +0530 you wrote:
> As it was pointed out by Yonghong Song [1], in the bpf selftests the use
> of the ASSERT_* series of macros is preferred over the CHECK macro.
> This patch replaces
23 matches
Mail list logo