← Back to Pull requests

Make eBPF verifier source maps independent of DWARF layout #57346

Closed
unknown closed this pull request without merging on Oct 02, 2026 23:06 UTC
View on GitHub
unknown unknown commented on Oct 01, 2026 19:33 UTC
Author

What does this PR do?


Make getSourceMap take each instruction's file, line and source text from the BTF line info cilium/ebpf attaches to it, instead of matching DWARF line sequences to ELF sections.

Motivation


Unblock:
  • #57337,

  • #57497.
  • A source map should only depend on information attached to each program's instructions, not on how the compiler happens to lay out debug information.

    PR #57337 made TestGetSourceMap fail on all CWS objects with "missing line information at initial instruction for program ...": once its helpers are static, clang no longer emits DWARF line sequences in executable section order (257 of 589 misaligned in runtime-security-fentry.o), which buildSymbolToSequenceMap relied on.

    In that case, DWARF is also gone from stripped objects, which ship and which KMT may therefore want to test, while BTF line info, which the verifier logs this tool analyzes refer to, stays.

    Describe how you validated your changes


    Locally, TestGetSourceMap passed:
  • on the 31 objects of _BAZEL_EBPF_{PREBUILT,CORE}_TARGETS, unstripped and stripped, also comparing every line with source files, while the previous code failed on all stripped ones with "cannot read DWARF data",

  • on the 3 CWS objects of #57337, unstripped and stripped, while the previous code failed with "missing line information at initial instruction" and "cannot read DWARF data" respectively.
  • In CI, it passed in the 39 kmt_run_sysprobe_tests_: [, no_usm] jobs:

  • on this PR: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/141762416

  • once cherry-picked onto #57337: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/pipelines/141764644
  • Diff: 212 lines (+159 / -53) across 2 files Reviewer: brycekahle Review duration: 1653m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 212 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Diff Size diff_size
    0.321
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #57346"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.5% (MEDIUM) · Higher = larger blast radius
    36.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 14.4% · Safe to merge
    14.4%