Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LDDW with src_reg > 1 #533

Open
Officeyutong opened this issue Oct 6, 2023 · 2 comments
Open

Add support for LDDW with src_reg > 1 #533

Officeyutong opened this issue Oct 6, 2023 · 2 comments

Comments

@Officeyutong
Copy link

Officeyutong commented Oct 6, 2023

It seems that ebpf-verifier will reject programs containing LDDW instructions with src_reg greater than 1.

At

if (inst.src > 1 || inst.dst > R10_STACK_POINTER || inst.offset != 0)

But the eBPF standard defined the usage when specifying src_reg to 2,3,4,5,6. See https://docs.kernel.org/bpf/standardization/instruction-set.html#id20

As a result, ebpf-verifier will reject the probe program produced by libbpf (See https://github.com/libbpf/libbpf/blob/e26b84dc330c9644c07428c271ab491b0f01f4e1/src/libbpf.c#L4650)

@Officeyutong Officeyutong changed the title Add support for LDDW with src > 1 Add support for LDDW with src_reg > 1 Oct 6, 2023
@dthaler
Copy link
Contributor

dthaler commented Feb 6, 2024

llvm-objdump shows these instructions as ld_pseudo:

18 00 00 00 ff ff ff ff 00 00 00 00 ff ff ff ff r0 = -0x1 ll
18 11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r1, 0x1, 0x0
18 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r2, 0x2, 0x0
18 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r3, 0x3, 0x0
18 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r4, 0x4, 0x0
18 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r5, 0x5, 0x0
18 66 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r6, 0x6, 0x0
18 77 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ld_pseudo       r7, 0x7, 0x0

@dthaler
Copy link
Contributor

dthaler commented Feb 6, 2024

The IETF specification does cover these now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants