lib: add a REJECT verdict for XDP #646
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 236 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.327
Real PR Conversation Timeline
1 comments
"Review active on #646"
general
weight: 0.35
JonSnow1807
Summary
Adds a terminal, rule-only
REJECTverdict for XDP chains. IPv4 packets get an ICMP port unreachable (type 3 code 3) and IPv6 packets an ICMPv6 port unreachable (type 1 code 4), built in place by two new ELF stubs and sent back withXDP_TX. The reply type is stored per rule (rule.reject_type, port-unreachable by default) with a per-type table inxdp.c, so other reject types can be added later. Packets the kernel’sicmp_send()wouldn’t answer (non-first fragments, ICMP errors, broadcast/multicast, malformed headers) are dropped instead. Other hooks refuse the verdict at load time, likeREDIRECT.Related issue
Fixes #565
Testing
Built in
ghcr.io/meta/bpfilter:fedora-44-x64on a KVM VM (kernel 6.8): unit 25/25, e2e 106/106, integration 3/3, check 5/5, and the docs build with no warnings. The new REJECT e2e tests also pass on 6.6.162 with the virtme-ng harness. Through a veth,pingandping -6print “Destination Port Unreachable” and “Destination unreachable: Port unreachable”, and UDP/TCP clients getECONNREFUSED.Notes for the reviewer
bfclionly accepts a bareREJECTfor now. What syntax would you like for picking another type later, e.g.REJECT tcp-reset?AI disclosure
Code drafted by both human and AI, and reviewed by human.
Checklist
make -C $BUILD testpasses and the code follows the style guidecomponent: subcomponent: short description