Skip to content

feat(validator): manifest program-type override (general form of #40 auto-type) + trace_dns case study#41

Merged
ErenAri merged 1 commit into
mainfrom
feat/prog-type-override
Jun 22, 2026
Merged

feat(validator): manifest program-type override (general form of #40 auto-type) + trace_dns case study#41
ErenAri merged 1 commit into
mainfrom
feat/prog-type-override

Conversation

@ErenAri

@ErenAri ErenAri commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

Two pieces that were authored alongside the auto-typing in #40 but didn't make it into that squash-merge (this lands them on top of main):

  1. Manifest-declared program-type overrideprogram_types: entries set a program's BPF type explicitly, the general form of the socket-filter auto-typing already in main:

    program_types:
      - program: socket1        # program name OR ELF section
        type: socket_filter

    Surfaced to the validator as --set-prog-type <program|section>=<type>; applied before auto-typing so an explicit override wins. Threaded through manifest schema + validation, runner tuning, the VM command line, and the validator. Supported types: socket_filter, kprobe, tracepoint, raw_tracepoint, xdp, perf_event, cgroup_skb, cgroup_sock, sched_cls, sched_act, sk_skb, sk_msg, tracing, lsm. Reported per override in the run notes.

  2. trace_dns case-study finding in docs/case-study-inspektor-gadget.md: trace_dns hits two loader contracts — program type (handled by auto-type / this override) then a CO-RE relocation against Inspektor Gadget's socket-enricher API type gadget_socket_value (BTF injected by the IG runtime). The latter is a framework dependency, not a kernel-compat gap — the honest boundary of standalone gadget validation.

Verification

Verified end-to-end on the box earlier: a program_types: manifest for trace_dns produced program type override applied: "socket1" (taking precedence over auto-typing), with the load then advancing to the framework CO-RE boundary. Tests added for manifest validation + CLI-arg construction; go build, go vet, gofmt, go test ./... clean; validator C compiles clean.

🤖 Generated with Claude Code

Add a manifest-declared program-type override — `program_types:`
({program: <name-or-section>, type: <bpf-type>}) — the general form of the
socket-filter auto-typing: set any program's BPF type explicitly for objects
libbpf can't classify from the section name. Threaded through manifest schema
+ validation, runner tuning, the VM command line
(`--set-prog-type <program|section>=<type>`), and the validator (applied
before auto-typing, so an explicit override wins). Reported per override in
the run notes. Verified end-to-end: trace_dns's socket1 program is typed via
the override, then advances to the framework CO-RE boundary.

Also fold the trace_dns finding into docs/case-study-inspektor-gadget.md: it
hits two loader contracts — program type (now handled) then a CO-RE
relocation against IG's socket-enricher API (gadget_socket_value), the honest
boundary of standalone gadget validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ErenAri ErenAri merged commit e43db64 into main Jun 22, 2026
7 of 8 checks passed
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

Successfully merging this pull request may close these issues.

1 participant