verify-prevail

作者: microsoft

诊断来自PREVAIL验证器的eBPF程序验证失败。此技能适用于在独立PREVAIL中验证的兼容Linux的eBPF程序…

npx skills add https://github.com/microsoft/ebpf-for-windows --skill verify-prevail

Diagnose PREVAIL Verification Failures (Linux-Compatible Programs)

Diagnose eBPF program verification failures using the standalone PREVAIL verifier (external/ebpf-verifier). This skill covers linux-compatible eBPF programs that can be verified directly with the PREVAIL check or run_yaml tools.

When to Use

  • User shares a PREVAIL verifier error or log and asks why verification failed
  • User asks to diagnose, debug, or explain an eBPF verification failure in the PREVAIL repo (external/ebpf-verifier)
  • User asks to debug PREVAIL YAML test failures or abstract-interpretation issues
  • User is working on verifier internals (abstract domains, widening, transformers)
  • User mentions "verifier", "verification", "PREVAIL", or "abstract interpretation" errors for linux-compatible BPF programs

When NOT to Use

  • Program uses Windows-specific helpers or headers (e.g., ebpf_helpers.h, sample_ext_helpers.h, WFP hook types) → use verify-bpf instead
  • User wants to run the bpf2c pipeline (clang → bpf2c → native driver) → use verify-bpf instead
  • User needs to compile a .c BPF source to .o for ebpf-for-windows → use verify-bpf instead

Reference Document

Read the full PREVAIL diagnostic reference before diagnosing:

external/ebpf-verifier/docs/llm-context.md

This document contains:

  • How to interpret PREVAIL log output (register state, stack state, invariants)
  • Glossary of log terms, types, type groups, and assertions
  • Common failure patterns with symptoms, causes, and fixes
  • Advanced topics (widening, path-insensitivity, pointer provenance)
  • A step-by-step reasoning protocol for diagnosis

Always read this file first — it is the authoritative reference for PREVAIL diagnostics.

Diagnosis Instructions

Step 1: Read the Reference

Read external/ebpf-verifier/docs/llm-context.md to load the full diagnostic context.

Step 2: Gather the Error

Ask the user to provide (if not already given):

  1. The verifier error message (the line with <pc>: <message> (<assertion>))
  2. The pre-invariant at the failing instruction
  3. The 3–5 instructions leading up to the failure
  4. The source code of the eBPF program (or the relevant section)
  5. Any map or context definitions (for map/context-related errors)

Step 3: Identify the Failure Pattern

Using the reference document, match the error to one of the common failure patterns:

PatternKey Symptom
Uninitialized registerInvalid type (r<N>.type in {...})
Unbounded packet accessUpper bound must be at most packet_size
Stack out-of-boundsLower bound must be at least r10.stack_offset - EBPF_SUBPROGRAM_STACK_SIZE
Null pointer (map lookup)Possible null access
Type mismatchOnly pointers can be dereferenced
Pointer arithmetic errorOnly numbers can be added to pointers
Infinite loopLoop counter is too large (pc[N] < 100000)
Division by zeroPossible division by zero
Map key/value mismatchIllegal map update with a non-numerical value
Context bounds violationNonzero context offset or context Upper bound error
Lost correlation (verifier limitation)Bounds check present but verifier can't prove safety

Step 4: Trace the Root Cause

Follow the reasoning protocol from the reference:

  1. Check the pre-invariant — what types and constraints do the relevant registers have?
  2. Identify missing constraints — what constraint would make the assertion pass?
  3. Trace backwards — where was the constraint lost or never established?
  4. Check for verifier limitations — is this a code bug or a verifier precision issue?

Step 5: Recommend a Fix

Provide:

  1. A clear explanation of why verification failed
  2. The specific constraint that is missing or violated
  3. A concrete code fix (with before/after examples when possible)
  4. If it's a verifier limitation, suggest workarounds (direct pointer comparisons, restructured control flow, etc.)

Important Notes

  • PREVAIL is more conservative than the Linux kernel verifier — code accepted by Linux may be rejected by PREVAIL.
  • PREVAIL is path-insensitive — it uses a single abstract state per program point, so correlated conditions across branches may be lost.
  • Widening at loop headers can destroy constraints — if a loop-related failure occurs, check whether widening eliminated a needed bound.
  • Never assume a register has a type or constraint unless it appears in the pre-invariant.

来自 microsoft 的更多技能

oss-growth
microsoft
OSS增长黑客角色
agent-framework-azure-ai-py
microsoft
使用Microsoft Agent Framework Python SDK(agent-framework-azure-ai)构建Azure AI Foundry代理。在创建使用AzureAIAgentsProvider的持久化代理、使用托管工具(代码解释器、文件搜索、网络搜索)、集成MCP服务器、管理对话线程或实现流式响应时使用。涵盖函数工具、结构化输出和多工具代理。
development
airunway-aks-setup
microsoft
在AKS上设置AI Runway——从裸集群到运行模型。涵盖集群验证、控制器安装、GPU评估、提供商设置和首次部署。适用场景:“设置AI Runway”、“接入AKS集群”、“安装AI Runway”、“airunway设置”、“将模型部署到AKS”、“在AKS上进行GPU推理”、“在AKS上配置KAITO”、“在AKS上运行LLM”、“在AKS上使用vLLM”、“在AKS上设置模型服务”、“AI Runway控制器”。
devops
appinsights-instrumentation
microsoft
使用Azure Application Insights对Web应用进行插桩的指南。提供遥测模式、SDK设置和配置参考。适用场景:如何对应用进行插桩、App Insights SDK、遥测模式、什么是App Insights、Application Insights指南、插桩示例、APM最佳实践。
devops
applicationinsights-web-ts
microsoft
使用Application Insights JavaScript SDK(@microsoft/applicationinsights-web)为浏览器/Web应用添加检测。用于真实用户监控(RUM)——页面视图、点击、AJAX/fetch依赖项、异常、自定义事件,以及与后端OpenTelemetry追踪关联的浏览器端GenAI代理追踪。涵盖SDK加载器脚本和npm设置、框架扩展(React、React Native、Angular)、点击分析、遥测初始化器,以及从浏览器发出的代理/工具/模型跨度所遵循的OTel GenAI语义约定。
devops
azure-ai-anomalydetector-java
microsoft
使用适用于 Java 的 Azure AI 异常检测器 SDK 构建异常检测应用程序。在实现单变量/多变量异常检测、时间序列分析或 AI 驱动的监控时使用。
development
azure-ai-language-conversations-py
microsoft
使用azure-ai-language-conversations Python SDK实现对话语言理解(CLU)。当使用ConversationAnalysisClient分析对话意图和实体、构建NLP功能或将语言理解集成到应用程序中时使用。
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python。用于机器学习工作区、作业、模型、数据集、计算资源和管道。 触发词:“azure-ai-ml”、“MLClient”、“工作区”、“模型注册表”、“训练作业”、“数据集”。
development