Skip to content
Back to skills

Kernel Execution Flow

ASecurity

Use when a Linux kernel PR diff changes C/Rust control flow, traces execution statically (Sashiko stage 3): broken error paths, NULL derefs, uninitialized or stale values, off-by-one loop logic, preprocessor/linkage hazards in the CHANGED code only. Part of the linux-kernel-review suite.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 5, 2026
code-qualityrustgogitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 5, 2026

npx -y skills add gvago/unofficial-qodo-review-skills --skill kernel-execution-flow --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Kernel Execution Flow?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Kernel Execution Flow
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gvago-kernel-execution-flow/badge)](https://www.skillsdirectory.com/skills/gvago-kernel-execution-flow)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: kernel-execution-flow
description: "Use when a Linux kernel PR diff changes C/Rust control flow, traces execution statically (Sashiko stage 3): broken error paths, NULL derefs, uninitialized or stale values, off-by-one loop logic, preprocessor/linkage hazards in the CHANGED code only. Part of the linux-kernel-review suite."
license: Apache-2.0
metadata:
  author: Sashiko contributors / Chris Mason
  adapted_by: gvago
  source: https://github.com/sashiko-dev/sashiko (Apache-2.0), references from masoncl/review-prompts (MIT)
  variant: review
  version: 1.0.0
---

# kernel-execution-flow

Lens for control-flow and logic verification (Sashiko stage 3). Acts as a
static analysis engine tracing C (or Rust) execution flow through the diff.

## How to apply

- Trace every branch, switch, loop, and goto in the changed code.
- Explore every error handling path (goto cleanup;) and prove it behaves
  correctly under failure.
- Never make assumptions from return types, comments, WARN_ON/BUG_ON, or
  error-handling patterns, verify by tracing concrete execution paths.
  Full tracing discipline: references/technical-patterns.md.
- For deadlock/infinite-wait/crash candidates, prove the path is
  structurally possible, not that it fires every run. Method:
  references/callstack.md.

## Rule index

- F1. Logic errors: incorrect loop conditions, inverted tests, off-by-one
  in bounds, wrong operator precedence.
- F2. Unhandled error paths and missing return-value checks. Checking
  returns of allocation, init, locking, and resource-management calls is a
  mandatory kernel API contract, not defensive programming. Exceptions:
  __init/early-boot code, debugfs APIs, teardown paths, explicit (void)
  casts with sound justification.
- F3. NULL pointer dereference. Reading a pointer field is not a
  dereference; only accessing its contents is. Prove the NULL can reach the
  access.
- F4. Preprocessor and linkage correctness: CONFIG_ prefix misspellings
  (e.g. HAVE_ where CONFIG_ was intended), #ifdef branch divergence,
  static/inline or section placement that breaks linking or loses symbols
  under LTO.

## Mapping a finding to the contract

- action_level: action_required for a proven logic error or mandatory
  unchecked return on a real path; remediation_recommended when the failure
  path is real but consequence is contained.
- category: Correctness.
- evidence: the traced path, caller, condition values, and the line where
  behavior diverges from intent.

## What NOT to flag

- Errors impossible in the call path found (e.g. guarded by IS_ENABLED
  upstream). Prove reachability before reporting.
- Defensive bounds checks without a proven untrusted source.
- likely()/unlikely() hint changes with no logic impact.

## References (load only when needed)

- references/technical-patterns.md, core kernel tracing rules, context
  rules, error-handling notes, RCU mandatory check.
- references/callstack.md, blocking/waiting bug analysis protocol.

## Sourcing

Stage text adapted from Sashiko (Apache-2.0). References reproduced from
masoncl/review-prompts (MIT).

Files in this skill

  • SKILL.md3 KB
  • references/callstack.md16.5 KB
  • references/technical-patterns.md8.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.