RFC 9669 Section 5.4 defines {IMM, DW, LD} (LDDW) as a family of wide-immediate instructions where src_reg selects a subtype.
In addition to the plain 64-bit immediate (src_reg == 0), RFC 9669 defines subtypes such as:
src_reg == 0x1: dst = map_by_fd(imm)
src_reg == 0x2: dst = map_val(map_by_fd(imm)) + next_imm
src_reg == 0x3: dst = var_addr(imm)
src_reg == 0x4: dst = code_addr(imm)
src_reg == 0x5: dst = map_by_idx(imm)
src_reg == 0x6: dst = map_val(map_by_idx(imm)) + next_imm
Current uBPF behavior:
- Appears to only accept/execute the plain 64-bit immediate form (
src_reg == 0).
- RFC 9669 LDDW subtypes with
src_reg != 0 are rejected and/or not executed.
Expected behavior:
- Either implement the RFC 9669 LDDW subtypes, or document uBPF’s conformance claims/limitations clearly (since these are in RFC 9669 base64).
RFC reference:
- RFC 9669 Section 5.4 and Appendix A opcode registry entries for opcode 0x18 subtypes.