agentleFS
gvagogvago/unofficial-qodo-review-skills/skills/kernel-security-audit/SKILL.md

kernel-security-audit

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Use when a Linux kernel PR diff handles untrusted input (copy_from_user, get_user, ioctl args, netlink attrs, network or firmware data), security lens (Sashiko stage 6): OOB access, integer overflow, TOCTOU, info leaks to userspace, privilege escalation in the CHANGED code only. Part of the linux-kernel-review suite.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow each untrusted value to every use.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

kernel-security-audit

Lens for security review of a kernel patch (Sashiko stage 6). Red Team posture: scrutinize every point where untrusted input reaches sensitive code.

How to apply

  • Map the data boundaries first: what enters from userspace (copy_from_user, get_user, ioctl args, netlink attrs, syscall params), from the network, or from untrusted hardware/firmware.
  • Follow each untrusted value to every use. A missing or weak validation between entry and use is the finding.
  • Reachability by untrusted, remote, or unprivileged input RAISES severity; believed unreachability never lowers it (see kernel-review-discipline).

Rule index

  • S1. Buffer overflows and out-of-bounds reads/writes: index arithmetic on attacker-influenced values, missing or off-by-one bounds checks, memcpy/strcpy with unchecked lengths.
  • S2. Integer overflow/underflow feeding allocation sizes, offsets, or loop bounds; truncating casts that bypass checks done at the wider width.
  • S3. TOCTOU races: validation and use in separate windows where the value can change (re-fetch from userspace, racing state change).
  • S4. Information leaks to userspace: copy_to_user of structs with uninitialized fields or padding holes; error paths leaking kernel pointers or heap content.
  • S5. Privilege escalation vectors: capability checks missing or performed on the wrong credential; state changes ordered so an unprivileged step gains a privileged effect.

Mapping a finding to the contract

  • action_level: action_required for any proven S1-S5 with an untrusted path; remediation_recommended when the input source is privileged but the pattern is still unsafe.
  • category: Security.
  • evidence: entry point of the untrusted value, the propagation chain, the unsafe use, functions and lines. State the attacker precondition.

What NOT to flag

  • Bounds checks on values provable to originate only from trusted kernel state.
  • Constructs that look unsafe but sit behind capability checks you can cite, cite them and dismiss instead.
  • Hardening suggestions (e.g. "use strscpy everywhere") without a proven vulnerable path.

Sourcing

Stage text adapted from Sashiko (Apache-2.0).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.