Skip to content

Update verifier submodule, fix breaking changes.#5216

Merged
saxena-anurag merged 13 commits into
mainfrom
user/anusa/user/anusa/update_verifier_submodule2
May 13, 2026
Merged

Update verifier submodule, fix breaking changes.#5216
saxena-anurag merged 13 commits into
mainfrom
user/anusa/user/anusa/update_verifier_submodule2

Conversation

@saxena-anurag
Copy link
Copy Markdown
Contributor

@saxena-anurag saxena-anurag commented Apr 30, 2026

Description

This PR updates the external verifier submodule that contains one ASAN fix and a couple of other fixes needed for array map optimization, along with code refactoring to integrate with latest verifier options and program context handling changes with eBPF code.

Dependency and Compatibility Updates:

  • Updated the external/ebpf-verifier submodule to point to the new prevail repository, and advanced to a newer commit. This ensures we use the latest upstream verifier codebase. [1] [2]
  • Added a typedef to provide backwards compatibility for the renamed ebpf_context_descriptor_t (now ebpf_ctx_descriptor_t) in the verifier, ensuring existing code continues to work.

Verifier Options and API Refactoring:

  • Refactored all usage of ebpf_verifier_options_t to the new VerifierOptions struct throughout the API, aligning with upstream changes and improving code clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated the construction and usage of verifier options to use new field names and structures, such as runtime and must_have_exit, reflecting the latest verifier API.

Program and Analysis Context Handling:

  • Modified the verification flow to use a new AnalysisContext object, passing it to the analysis routines and invariant printing, which improves modularity and future extensibility.
  • Changed the way program type information is set and accessed during verification, including thread-local storage improvements for program type under verification. [1] [2]

Windows Helper and Map Descriptor Improvements:

  • Updated Windows-specific helper prototype and usability checks to accept the program type as an argument, and improved how program type info is retrieved, making the API more robust and explicit. [1] [2]
  • Renamed context_descriptor to ctx_descriptor in several places for consistency with upstream changes, and updated memory management accordingly. [1] [2] [3]
  • Improved map descriptor lookup on Windows by requiring the caller to provide the descriptor list, making the function safer and more predictable.

Verifier Instruction and Call Resolution:

  • Updated instruction type and call analysis to use the new call_resolver logic and pass ProgramInfo as needed, improving accuracy in statistics and reporting. [1] [2] [3]

These changes collectively modernize the verifier API, improve compatibility with upstream changes, and enhance the maintainability and correctness of the codebase.

Testing

Existing CICD.

If new tests were added:

  • Unit tests are added.
  • Driver tests are added.

Documentation

No

Installation

No

@github-actions
Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@saxena-anurag saxena-anurag changed the title [DRAFT]: DO NOT REVIEW Update verifier submodule, fix breaking changes. May 4, 2026
@saxena-anurag saxena-anurag marked this pull request as ready for review May 4, 2026 15:46
Comment thread include/ebpf_program_types.h Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

mikeagun
mikeagun previously approved these changes May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

@saxena-anurag saxena-anurag requested a review from mikeagun May 12, 2026 19:27
@github-actions
Copy link
Copy Markdown
Contributor

This pull request isn't linked to any GitHub issue. Please reference an issue with a keyword such as Fixes #123, Closes #456, etc., so the work can be tracked.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the PREVAIL verifier integration (including the external/ebpf-verifier submodule migration) and refactors the eBPF-for-Windows verifier-facing API surface to match upstream breaking changes (e.g., VerifierOptions, AnalysisContext, and ebpf_ctx_descriptor_t naming).

Changes:

  • Updated verifier option plumbing to use prevail::VerifierOptions and newer analysis APIs (AnalysisContext, updated printing helpers).
  • Renamed/adjusted context descriptor usage across the codebase (ebpf_context_descriptor_tebpf_ctx_descriptor_t) and updated serialization/store interactions accordingly.
  • Tightened Windows verifier platform hooks (helper usability/prototype now takes program type; map descriptor lookup API now takes descriptor list).

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
undocked/tests/sample/ext/inc/sample_ext_program_info.h Rename sample extension context descriptor type to ebpf_ctx_descriptor_t.
tests/libfuzzer/netebpfext_fuzzer/libfuzz_harness.cpp Update fuzzer harness context descriptor pointer type.
tests/export_program_info_test/export_program_info_test.cpp Update exported program-info test context descriptor type.
tests/end_to_end/helpers.h Update end-to-end test context descriptor type.
tests/cilium/cilium_tests.cpp Include/format tweaks and context descriptor type update.
scripts/check_binary_dependencies_ebpfsvc_exe_regular_debug.txt Adjust expected dependency list for ebpfsvc.exe debug build.
netebpfext/net_ebpf_ext_program_info.h Update network extension program context descriptor type.
libs/store_helper/ebpf_store_helper.c Store context descriptor using sizeof(ebpf_ctx_descriptor_t).
libs/shared/shared_common.c Validate/duplicate program descriptors using ebpf_ctx_descriptor_t.
libs/shared/ebpf_serialize.c Serialize/deserialize program type descriptor context using ebpf_ctx_descriptor_t.
libs/service/verifier_service.cpp Switch verifier options to prevail::VerifierOptions.
libs/service/api_service.cpp Pass program type into helper prototype queries during helper-id mapping.
libs/runtime/unit/platform_unit_test.cpp Update serialization unit test to use ebpf_ctx_descriptor_t.
libs/execution_context/unit/execution_context_unit_test.cpp Update unit test declarations/uses for new descriptor type.
libs/execution_context/ebpf_program.c Update context descriptor types used in context header accessors and context-data lookup.
libs/api/windows_platform.cpp Update platform map parsing signature to const VerifierOptions&.
libs/api/Verifier.h Update verifier-related typedefs/APIs to VerifierOptions.
libs/api/Verifier.cpp Update instruction stats/call classification to use call resolver and updated print APIs.
libs/api/ebpf_api.cpp Use VerifierOptions when loading/verifying from ELF.
libs/api_common/windows_platform_common.hpp Update Windows platform helper/map descriptor APIs; add verification program-type setters/getters.
libs/api_common/windows_platform_common.cpp Implement program-type info lookup by program type; add TLS program-type tracking.
libs/api_common/windows_helpers.cpp Require program type for helper usability/prototype checks; populate verifier prototype with ctx descriptor.
libs/api_common/store_helper_internal.cpp Update store-loading to allocate/read ebpf_ctx_descriptor_t.
libs/api_common/api_common.hpp Update verifier API signatures to VerifierOptions.
libs/api_common/api_common.cpp Update verification flow to use AnalysisContext + new options fields; set TLS program type for verification.
include/ebpf_program_types.h Update program type descriptor’s context pointer type.
docs/PerfEventArray.md Update docs to reference ebpf_ctx_descriptor_t.
docs/eBpfExtensions.md Update extension documentation and examples for new context descriptor naming.
.gitmodules Move verifier submodule URL to https://github.com/vbpf/prevail.git.

Comment on lines 183 to +188
if (info.type.platform_specific_data == (uintptr_t)&EBPF_PROGRAM_TYPE_UNSPECIFIED) {
throw std::runtime_error("Unspecified program type.");
}
const auto program = prevail::Program::from_sequence(instruction_sequence, info, options);
auto analysis_result = prevail::analyze(program);
set_verification_program_type(&info.type);
auto program = prevail::Program::from_sequence(instruction_sequence, info, options);
prevail::AnalysisContext context{std::move(program), options};
_In_ const void* program_context, _Out_ const uint8_t** data_start, _Out_ const uint8_t** data_end)
{
ebpf_context_descriptor_t* context_descriptor;
ebpf_ctx_descriptor_t* context_descriptor;
Comment on lines 132 to 136
instruction.imm = helper_id_mapping[instruction.imm];
}
for (auto& [old_helper_id, new_helper_id] : helper_id_mapping) {
if (get_helper_prototype_windows(old_helper_id).return_type !=
if (get_helper_prototype_windows(old_helper_id, program_type).return_type !=
EBPF_RETURN_TYPE_INTEGER_OR_NO_RETURN_IF_SUCCEED) {
@saxena-anurag saxena-anurag added this pull request to the merge queue May 13, 2026
Merged via the queue into main with commit 094e6c7 May 13, 2026
118 checks passed
@saxena-anurag saxena-anurag deleted the user/anusa/user/anusa/update_verifier_submodule2 branch May 13, 2026 21:41
@github-project-automation github-project-automation Bot moved this from Todo to Done in eBPF for Windows Triage May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants