False Positive Prevention Guide
It is critical this prompt is fully processed in a careful, systematic way.
It is used during the false positive section of the review, where avoiding
false positives is of utmost importance. You need to shift all bias
away from efficient processing and focus on following these instructions
as carefully as possible.
Core Principle
If you cannot prove an issue exists with concrete evidence, do not report it.
Corollary (from callstack.md): For deadlocks, infinite waits, crashes, and
data corruption, "concrete evidence" means proving the code path is structurally
possible — not proving it will definitely execute on every run. A
wait_event with no timeout and no fallback wake condition is a deadlock bug
if the wake condition depends on external events that can stop. Do not dismiss
such bugs as "unlikely in practice."
This file contains instructions to help you prove a given bug is real. You
must follow every instruction in every section. Do not skip steps, and you
must complete task POSITIVE.1 before completing the false positive check.
Common False Positive Patterns
0. Context preservation
- If you're analyzing a git commit make sure the full commit message is still in context. If not, reload it.
- If you're processing a patch instead of a commit, make sure the full
patch description is still in context. If not, reread it.
- Confirm this context is available for the false positive section
- Do not proceed with false positive verification without this context ready
1. Defensive Programming Requests
Never suggest defensive checks unless you can prove:
- The input comes from an untrusted source (ex: user/network)
- An actual path exists where invalid data reaches the code
- The current code can demonstrably fail
Examples:
- ❌ "Add bounds check here for safety"
- ❌ "This should validate the index"
- ✅ "User input at funcA() can reach this without validation"
1.1 Failure to handle errors
Never report failure to handle errors unless
- You can prove the error is possible
- You've confirmed the function arguments used don't prevent the error
2. API Misuse Assumptions
Never report issues based on theoretical API misuse unless you can prove:
- An actual calling path exists that triggers the issue
- The function naming/documentation doesn't clearly indicate usage constraints
- Similar kernel APIs validate the same preconditions
3. Unverifiable Assumptions
Assume the author is wrong and require proof they are correct
- Look for the author in the MAINTAINERS file, if found, assume their comments,
commit messages and assertions in the patch's modified code are correct.
Comments and documentation in existing unmodified code must still be verified
against the actual implementation per section 3.1.
- Untrusted sources (network/user) always need concrete proof of correctness
- Research assumptions and claims in commit messages, comments and code, prove them correct
- If the author makes claims without code evidence, treat them as unverified
- Design decisions must be justified by code or documentation
- Read the entire commit message. If the commit message explains a given behavior,
verify the explanation is correct with code evidence.
- Read the surrounding code comments. Verify comments accurately describe the code behavior.
Report unless:
- You found specific code that proves the author correct
- You can verify all assumptions with concrete code paths
- The behavior is proven correct, not just claimed
3.1 Comment-Based Dismissals (MANDATORY)
CRITICAL: When dismissing an issue because a comment or documentation says
the code behaves a certain way, you MUST verify against the actual implementation:
Read the function body, not just the comment
- Comments can be copy-pasted to multiple implementations with different semantics
- The same comment may appear on both sides of an
#ifdef/#else block
- Output: quote the actual implementation code, not just the comment
Check for conditional compilation
- If code has
#ifdef CONFIG_FOO / #else branches, determine which applies
- A comment describing behavior in one branch may not apply to the other
- Output: which config branch applies and why
Verify helper function behavior
- If dismissing because "function X returns Y", read function X's implementation
- Check if function X has config-dependent behavior
- Output: quote function X's implementation showing it guarantees the claimed behavior
When in doubt, report the issue
- If you cannot verify the comment matches the implementation under all configs, report it
- A bug dismissed based on incorrect documentation is worse than a false positive
4. Locking False Positives
Before reporting a locking issue:
- Check ALL calling functions for held locks
- Output: list each caller and locks it holds (e.g., "caller() holds mutex_x at file:line")
- Trace up 2-3 levels to find lock context
- Output: full lock chain from entry point to issue site
- Verify the actual lock requirements
- Output: quote lock documentation or convention (e.g., "must hold rcu_read_lock")
- Consider RCU and other lockless mechanisms
- Output: RCU/lockless mechanism found or "none applicable"
Common mistakes:
- Missing that caller holds the required lock
- Not recognizing RCU-protected sections
- Assuming all shared data needs traditional locks
5. Use-After-Free Confusion
Distinguish between:
- Use-after-free (accessing freed memory) ← Report this
- Use-before-free (using then freeing) ← Don't report
- Free-after-use (normal cleanup) ← Don't report
Verification:
- Trace the exact sequence of operations
- Output: sequence showing "alloc@loc → use@loc → free@loc → use@loc" or "no UAF found"
- Check if object ownership was transferred
- Output: ownership transfer point or "ownership retained"
6. Resource Leak Misconceptions
Not a leak if:
- Ownership was transferred to another subsystem
- Object was added to a list/queue for later processing
- Cleanup happens in a callback or delayed work
- It's in test code and doesn't affect the system
Verify by:
- Trace object ownership changes
- Output: ownership chain "alloc@loc → stored in X@loc → freed by Y@loc" or "leak confirmed"
- Check for async cleanup mechanisms
- Output: cleanup callback or workqueue handler, or "no async cleanup found"
- Understand subsystem ownership models
- Output: quote subsystem convention or "no documented model"
7. Order Changes
Don't report order changes unless you can prove:
- A race condition is introduced
- A dependency is violated
- An ABBA deadlock pattern emerges
- State becomes invalid
8. Races
- Identify the EXACT data structure names and definitions
- Output: struct name and location
- Identify the locks that should protect them
- Output: lock name and where it's defined
- Prove the race exists with CODE SNIPPETS
- Output: two code paths that can execute concurrently, with locations
8.1. Race Dismissal: Full-Path Verification (MANDATORY)
When dismissing a race because "the code detects the invalid state and aborts,"
you MUST verify the ENTIRE instruction sequence between the race window and the
recovery point. A single abort path later in the function does not make earlier
dereferences safe.
Before accepting a race dismissal, answer ALL of these:
- What exact instruction opens the race window?
- Output: function, file:line, what state becomes stale
- What exact instruction closes it (drain/barrier/lock)?
- Output: function, file:line, synchronization mechanism
- What is the "graceful handler" you claim makes this safe?
- Output: function, file:line, how it detects invalid state
- List every instruction between #1 and #3 that touches the contested
resource. Are ALL of them safe if the resource was invalidated by the
racing thread?
- Output: enumerate each instruction with verdict (safe/unsafe)
If you cannot affirmatively answer #4 for every intermediate instruction,
the dismissal is invalid. Report the race.
9. Performance Tradeoffs
Not a regression if:
- Lower performance was an intentional tradeoff
- Commit message explains the performance impact
- Simplicity/maintainability was prioritized
- It's optimizing for a different use case
10. Intentional backwards compatibility
- Leaving stub sysfs or procfs files is not required, and also not a regression
- It is not a regression for deprecated sysfs files to remain and just return
any constant value (0, empty strings, a specific fixed string are all ok),
as long as that value was legal for the interface before deprecation.
ONLY REPORT: if you can prove the resource contract has been broken
11. Subjective review patterns
- problems flagged by SR-* patterns are not bugs, they are opinions.
- But, they can still be wrong. Focus on checking against the commit message,
nearby code, nearby comments, and the "debate yourself" section of the
verification checklist.
12. Uninitialized variables
- assigning to a variable is the same as initializing it.
- passing uninitialized variables to a function is fine if that function writes
to them before reading them
- only report reading from uninitialized variables, not writing to them.
13. Implicit Guard Conditions
Before reporting NULL dereference:
- Review technical-patterns.md "NULL Pointer Dereference" section
- Load and fully analyze pointer-guards.md for EVERY NULL pointer
14. Patch series false positive removal
Large changes are broken up into small logical units in order to make them
easier to understand and review.
- Example correct patch series:
- PATCH 1: add a new API
- PATCH 2: change one subsystem or one file to use the new API
- PATCH 3-N: change all the other subsystems or files to use new API
- PATCH N+1: delete the old API
Do not try to review the judgements made in breaking up large changes. Just
look for objective bugs as per the review prompts and false positive guide.
If our potential bug is simply work in progress that is completed later in the series,
it is a false positive and should be ignored.
- Example incorrect patch series:
- PATCH 1: create a regression (crash, overflow, various bugs)
- PATCH 2: fix that regression
We expect each patch in the series to be working toward a larger goal, BUT
we require each patch to be self contained and correct. Specifically:
- Each patch must compile
- New bugs must not be introduced
Intermediate patches in a series may intentionally introduce performance issues
that are fixed later in the series. The commit message or comments in the code
should explain how this was intentional.
If you've identified a real regression fixed later in the patch series, you
must still report this regression []
- BUT, you must indicate in the bug report that you found the fix later in
the series []
- When reporting, include both the commit sha and the commit subject line []
Patch series Mandatory Validation
- Was a git range provided in the prompt? [ y / n, range ]
- Did you use it to search forward? [ y / n ]
15. Subsystem guide violations (hallucination check ONLY)
Issues tagged subsystem_guide_violation: true, or with category
guide-directive or issue_type: "potential-issue" with a guide_directive
field, are subsystem guide violations. The subsystem guide is authoritative —
the violation itself is treated as factually correct.
STOP. For these issues, ONLY perform these three hallucination checks. Do
NOTHING else. Do NOT apply sections 1-14. Do NOT apply TASK POSITIVE.1.
Does the cited guide rule exist? Re-read the subsystem guide and confirm
the quoted directive actually appears in the guide text. If the agent
fabricated or misquoted the rule, eliminate the issue.
Does the cited code exist? Confirm the function, variable, or code
pattern the agent cited is real. Use find_function or read the file. If
the agent hallucinated the code (wrong function name, nonexistent variable,
fabricated code path), eliminate the issue.
Does the code actually violate the guide rule? Read the cited code and
the guide rule side by side. Confirm the code does the thing the guide says
not to do (or fails to do the thing the guide requires). If the agent
mismatched rule to code — e.g., the guide prohibits pattern X but the code
does pattern Y, or the guide requires lock L but the code already holds
lock L — eliminate the issue.
If all three checks pass, PRESERVE the issue. You are done.
Explicit prohibitions for subsystem guide violations:
- Do NOT analyze whether the bug is "real" or "theoretical"
- Do NOT check if the code "handles it gracefully"
- Do NOT evaluate locking, races, reachability, or safety
- Do NOT apply your own reasoning about whether the pattern is dangerous
- Do NOT check callers, callees, or context beyond confirming the code exists
- Do NOT debate yourself about the issue
- The ONLY reason to eliminate is hallucination: fabricated rule or fabricated code
TASK POSITIVE.1 Verification Checklist
Complete each verification step below and produce the required output.
Do not skip steps. Do not claim completion without producing the output.
Before reporting ANY regression, verify:
For NULL pointer dereferences, review technical-patterns.md and load pointer-guards.md
- Output: "reviewed" or "not applicable - not a NULL dereference issue"
Can I prove this path executes?
- Find calling code that reaches here
- Output: quote the call chain with locations (e.g., "caller@file:line → target@file:line")
- Check for impossible conditions blocking the path
- Output: list conditions checked and their evaluation
- Verify not in dead code or disabled features
- Output: enabled-by config option or "always enabled"
Is the bad behavior structurally possible?
- Prove the code path exists and the triggering conditions are not structurally impossible
- Output: step-by-step execution path with function names and locations showing the failure
- Prove the failure mode is concrete (crash, deadlock, corruption, leak), not just "increases risk"
- Output: the specific failure mode and triggering condition
- NOTE: A deadlock, infinite wait, or crash that depends on runtime conditions
(timing, memory pressure, shutdown state, allocation patterns) is a real bug
if the code has no structural prevention (timeout, fallback wake condition,
bounded retry). Do not dismiss these by arguing the conditions are unlikely.
Did I check the full context?
- Examine calling functions (2-3 levels up)
- Output: list each caller checked with a random line from each
- Check initialization and cleanup paths
- Output: init/cleanup functions examined with locations
- Verify subsystem conventions
- Output: conventions found and whether code follows them
Is this actually wrong?
- Check if intentional design choice
- Output: quote commit message or comment if explains intent, else "no explanation found"
- Check if documented limitation
- Output: quote documentation if found, else "not documented"
- Verify not test code allowed to be imperfect
- Output: "production code" or "test code - severity adjusted"
- Confirm bug exists today, not just if code changes later
- Output: current triggering path or "theoretical future issue only"
- NOTE: "theoretical" means the code path cannot be reached today.
A bug that depends on runtime conditions (timing, system state) is
not theoretical — it is a real bug with a conditional trigger.
Did I check the commit message and surrounding comments?
- Read the entire commit message
- Output: quote any text explaining this behavior, or "no explanation found"
- Read surrounding code comments
- Output: quote relevant comments, or "no relevant comments"
When complex multi-step conditions are required for the bug to exist
- Prove these conditions are actually possible
- Output: code path showing each condition can be true simultaneously
Did I hallucinate a problem that doesn't actually exist?
- Verify the bug report matches the actual code
- Output: quote the exact code snippet from the file
- Reread the file and confirm code matches your analysis
- Output: file:line and verbatim code
- Check your math (division by zero requires zero in denominator, etc.)
- Output: arithmetic verification or "no arithmetic involved"
Did I check for future fixes in the same patch series?
- Search forward in git history (not back), only on this branch
- Output: commits checked or "no git range provided"
- If fix found later in series
- Output: "found fix in [commit] - reporting as real bug with later fix" or "no fix found"
If dismissing based on comments or documentation, verify the implementation
- Did you read the actual function implementation, not just the comment?
- Output: quote the implementation code that proves the comment is accurate
- Does the function have #ifdef/#else branches with different behavior?
- Output: list config options that affect behavior, state which applies
- Did you verify helper functions behave as their comments claim?
- Output: quote helper implementation or "no helper functions involved"
- If you cannot verify implementation matches documentation, do NOT dismiss
- Output: "implementation verified" or "cannot verify - reporting issue"
Debate yourself
- Do these two steps in order:
- 10.1 Pretend you are the author. Think extremely hard about the review and try to prove it incorrect.
- Check for hallucinations or invented information
- For NULL safety, ask as the author:
- Did reviewer search for similar code in my subsystem accessing this pointer?
- If reporting missing NULL check, did they explain why OTHER code in my subsystem HAS that check?
- Did they verify lifecycle dependencies or just analyze syntactically?
- Is there semantic coupling between guard condition and pointer validity they missed?
- Would adding their suggested check be redundant/paranoid given the invariants?
- Did they compare guard patterns - why does path A check NULL but path B doesn't?
- For locking, ask as the author:
- Did reviewer check what locks my caller holds?
- Did they understand lock context (process/softirq/hardirq/RCU)?
- Is there a lock held higher in the call chain they missed?
- For resource leaks, ask as the author:
- Did reviewer trace ownership transfer?
- Did they check for async cleanup mechanisms?
- Is the resource stored somewhere for later cleanup?
- For all issues, ask as the author:
- Did they check if this is intentional based on commit message or comments?
- Did they verify the conditions for the bug are actually possible?
- Are they confusing a structurally possible bug with a defensive programming suggestion?
- Output: strongest argument against reporting this bug
- IMPORTANT: "unlikely in practice" is not a valid argument against a
deadlock, crash, or data corruption. Only "structurally impossible"
(the code literally cannot reach that state) is valid. See
callstack.md "Reachability Dismissals".
- 10.2 Now pretend you're the reviewer. Think extremely hard about the author's arguments and decide if the review is correct.
- Address each author argument with code evidence
- Output: code evidence refuting the author, or "cannot refute with code - likely false positive"
Mandatory Validation
- If any Output requirement above is blank or skipped, repeat that step
- If you cannot produce code evidence for your conclusion, the bug is likely a false positive
Patch series
- You may only use this exact method to look forward in git history.
- NEVER invent other methods to look forward in git history.
- If the prompt included a range of git commits to check, look forward
through that range for later patches that might resolve the bug you found.
- Never search backwards in commit history.
Special Cases
Test Code
- Memory leaks in test programs → Usually OK
- File descriptor leaks in tests → Usually OK
- Unless it crashes/hangs the system → Report it
Assertions and Warnings
- Removing WARN_ON/BUG_ON → Not a regression
- Removing BUILD_BUG_ON → Not a regression
- Unless removing critical runtime checks → Then report
Reverts
- When reviewing reverts, focus on new issues
- Assume the original bug is known/handled
- Don't re-report the original problem
Subsystem Exclusions
- fs/bcachefs → Skip all issues
- Staging drivers → Lower standards apply
- Example/test code → Focus on system impact only
Final Filter
Before adding to report, think about the regression and ask:
- Do I have proof, not just suspicion? [ yes / no ]
- Code snippets showing all components required to trigger the bug count as proof
- ONLY if the conditions are also proven to be possible
- Existing defensive pattern checks for the same condition also count as proof.
- ONLY if you can prove the condition can occur
- Existing WARN_ON()/BUG_ON() don't count as proof.
- For deadlocks/hangs: showing that a wait has no timeout and no alternative
wake condition IS proof. You do not also need to prove the system will
definitely enter that state.
- Would an expert see this as a real issue? [ yes / no ]
- Is this worth the maintainer's time? [ yes / no ]
- Am I suggesting defensive programming, or reporting a concrete bug? [ yes / no ]
- Defensive programming: "add a NULL check here for safety" → discard
- Concrete bug: "this wait_event has no timeout and no fallback wake" → report
MANDATORY Final Filter validation
If you didn't answer yes to all 4 questions, investigate further or discard
Remember
- False positives waste everyone's time
- Missed bugs also waste everyone's time - a deadlock in production is worse than a false positive in review
- Kernel developers are experts - but experts miss bugs too, especially subtle interactions between subsystems (workqueues, notifiers, shutdown ordering)
- Real bugs have real proof - but proof means showing the code path exists and has no structural prevention, not proving the bug will definitely fire on every execution
1---2name: false-positive-prevention-guide-23description: It is critical this prompt is fully processed in a careful, systematic way. It is used during the false positive section of the review, where avoiding false positives is of utmost importance.4---5# False Positive Prevention Guide67It is critical this prompt is fully processed in a careful, systematic way.8It is used during the false positive section of the review, where avoiding9false positives is of utmost importance. You need to shift all bias10away from efficient processing and focus on following these instructions11as carefully as possible.1213## Core Principle14**If you cannot prove an issue exists with concrete evidence, do not report it.**1516**Corollary (from callstack.md)**: For deadlocks, infinite waits, crashes, and17data corruption, "concrete evidence" means proving the code path is structurally18possible — not proving it will definitely execute on every run. A19`wait_event` with no timeout and no fallback wake condition is a deadlock bug20if the wake condition depends on external events that can stop. Do not dismiss21such bugs as "unlikely in practice."2223This file contains instructions to help you prove a given bug is real. You24must follow every instruction in every section. Do not skip steps, and you25must complete task POSITIVE.1 before completing the false positive check.2627## Common False Positive Patterns2829### 0. Context preservation30- If you're analyzing a git commit make sure the full commit message is still in context. If not, reload it.31- If you're processing a patch instead of a commit, make sure the full32 patch description is still in context. If not, reread it.33- Confirm this context is available for the false positive section34- Do not proceed with false positive verification without this context ready3536### 1. Defensive Programming Requests37**Never suggest** defensive checks unless you can prove:38- The input comes from an untrusted source (ex: user/network)39- An actual path exists where invalid data reaches the code40- The current code can demonstrably fail4142**Examples**:43- ❌ "Add bounds check here for safety"44- ❌ "This should validate the index"45- ✅ "User input at funcA() can reach this without validation"4647### 1.1 Failure to handle errors48**Never report** failure to handle errors unless49 - You can prove the error is possible50 - You've confirmed the function arguments used don't prevent the error5152### 2. API Misuse Assumptions53**Never report** issues based on theoretical API misuse unless you can prove:54 - An actual calling path exists that triggers the issue55 - The function naming/documentation doesn't clearly indicate usage constraints56 - Similar kernel APIs validate the same preconditions5758### 3. Unverifiable Assumptions59**Assume the author is wrong** and require proof they are correct60- Look for the author in the MAINTAINERS file, if found, assume their comments,61 commit messages and assertions in the patch's modified code are correct.62 Comments and documentation in existing unmodified code must still be verified63 against the actual implementation per section 3.1.64- Untrusted sources (network/user) always need concrete proof of correctness65- Research assumptions and claims in commit messages, comments and code, prove them correct66- If the author makes claims without code evidence, treat them as unverified67- Design decisions must be justified by code or documentation68- Read the entire commit message. If the commit message explains a given behavior,69verify the explanation is correct with code evidence.70- Read the surrounding code comments. Verify comments accurately describe the code behavior.7172**Report unless**:73- You found specific code that proves the author correct74- You can verify all assumptions with concrete code paths75- The behavior is proven correct, not just claimed7677### 3.1 Comment-Based Dismissals (MANDATORY)78**CRITICAL**: When dismissing an issue because a comment or documentation says79the code behaves a certain way, you MUST verify against the actual implementation:80811. **Read the function body, not just the comment**82 - Comments can be copy-pasted to multiple implementations with different semantics83 - The same comment may appear on both sides of an `#ifdef/#else` block84 - Output: quote the actual implementation code, not just the comment85862. **Check for conditional compilation**87 - If code has `#ifdef CONFIG_FOO` / `#else` branches, determine which applies88 - A comment describing behavior in one branch may not apply to the other89 - Output: which config branch applies and why90913. **Verify helper function behavior**92 - If dismissing because "function X returns Y", read function X's implementation93 - Check if function X has config-dependent behavior94 - Output: quote function X's implementation showing it guarantees the claimed behavior95964. **When in doubt, report the issue**97 - If you cannot verify the comment matches the implementation under all configs, report it98 - A bug dismissed based on incorrect documentation is worse than a false positive99100### 4. Locking False Positives101**Before reporting** a locking issue:102- Check ALL calling functions for held locks103 - Output: list each caller and locks it holds (e.g., "caller() holds mutex_x at file:line")104- Trace up 2-3 levels to find lock context105 - Output: full lock chain from entry point to issue site106- Verify the actual lock requirements107 - Output: quote lock documentation or convention (e.g., "must hold rcu_read_lock")108- Consider RCU and other lockless mechanisms109 - Output: RCU/lockless mechanism found or "none applicable"110111**Common mistakes**:112- Missing that caller holds the required lock113- Not recognizing RCU-protected sections114- Assuming all shared data needs traditional locks115116### 5. Use-After-Free Confusion117**Distinguish between**:118- Use-after-free (accessing freed memory) ← Report this119- Use-before-free (using then freeing) ← Don't report120- Free-after-use (normal cleanup) ← Don't report121122**Verification**:123- Trace the exact sequence of operations124 - Output: sequence showing "alloc@loc → use@loc → free@loc → use@loc" or "no UAF found"125- Check if object ownership was transferred126 - Output: ownership transfer point or "ownership retained"127128### 6. Resource Leak Misconceptions129**Not a leak if**:130- Ownership was transferred to another subsystem131- Object was added to a list/queue for later processing132- Cleanup happens in a callback or delayed work133- It's in test code and doesn't affect the system134135**Verify by**:136- Trace object ownership changes137 - Output: ownership chain "alloc@loc → stored in X@loc → freed by Y@loc" or "leak confirmed"138- Check for async cleanup mechanisms139 - Output: cleanup callback or workqueue handler, or "no async cleanup found"140- Understand subsystem ownership models141 - Output: quote subsystem convention or "no documented model"142143### 7. Order Changes144**Don't report** order changes unless you can prove:145- A race condition is introduced146- A dependency is violated147- An ABBA deadlock pattern emerges148- State becomes invalid149150### 8. Races151- Identify the EXACT data structure names and definitions152 - Output: struct name and location153- Identify the locks that should protect them154 - Output: lock name and where it's defined155- Prove the race exists with CODE SNIPPETS156 - Output: two code paths that can execute concurrently, with locations157158### 8.1. Race Dismissal: Full-Path Verification (MANDATORY)159When dismissing a race because "the code detects the invalid state and aborts,"160you MUST verify the ENTIRE instruction sequence between the race window and the161recovery point. A single abort path later in the function does not make earlier162dereferences safe.163164Before accepting a race dismissal, answer ALL of these:1651. What exact instruction opens the race window?166 - Output: function, file:line, what state becomes stale1672. What exact instruction closes it (drain/barrier/lock)?168 - Output: function, file:line, synchronization mechanism1693. What is the "graceful handler" you claim makes this safe?170 - Output: function, file:line, how it detects invalid state1714. **List every instruction between #1 and #3 that touches the contested172 resource. Are ALL of them safe if the resource was invalidated by the173 racing thread?**174 - Output: enumerate each instruction with verdict (safe/unsafe)175176If you cannot affirmatively answer #4 for every intermediate instruction,177the dismissal is invalid. Report the race.178179### 9. Performance Tradeoffs180**Not a regression if**:181- Lower performance was an intentional tradeoff182- Commit message explains the performance impact183- Simplicity/maintainability was prioritized184- It's optimizing for a different use case185186### 10. Intentional backwards compatibility187- Leaving stub sysfs or procfs files is not required, and also not a regression188- It is not a regression for deprecated sysfs files to remain and just return189 any constant value (0, empty strings, a specific fixed string are all ok),190 as long as that value was legal for the interface before deprecation.191192**ONLY REPORT**: if you can prove the resource contract has been broken193194### 11. Subjective review patterns195- problems flagged by SR-* patterns are not bugs, they are opinions.196- But, they can still be wrong. Focus on checking against the commit message,197nearby code, nearby comments, and the "debate yourself" section of the198verification checklist.199200### 12. Uninitialized variables201- assigning to a variable is the same as initializing it.202- passing uninitialized variables to a function is fine if that function writes203to them before reading them204- only report reading from uninitialized variables, not writing to them.205206### 13. Implicit Guard Conditions207208**Before reporting NULL dereference**:209- Review technical-patterns.md "NULL Pointer Dereference" section210- Load and fully analyze pointer-guards.md for EVERY NULL pointer211212### 14. Patch series false positive removal213214Large changes are broken up into small logical units in order to make them215easier to understand and review.216217- Example correct patch series:218 - PATCH 1: add a new API219 - PATCH 2: change one subsystem or one file to use the new API220 - PATCH 3-N: change all the other subsystems or files to use new API221 - PATCH N+1: delete the old API222223Do not try to review the judgements made in breaking up large changes. Just224look for objective bugs as per the review prompts and false positive guide.225226If our potential bug is simply work in progress that is completed later in the series,227it is a false positive and should be ignored.228229- Example incorrect patch series:230 - PATCH 1: create a regression (crash, overflow, various bugs)231 - PATCH 2: fix that regression232233We expect each patch in the series to be working toward a larger goal, BUT234we require each patch to be self contained and correct. Specifically:235236- Each patch must compile237- New bugs must not be introduced238239Intermediate patches in a series may intentionally introduce performance issues240that are fixed later in the series. The commit message or comments in the code241should explain how this was intentional.242243If you've identified a real regression fixed later in the patch series, you244must still report this regression []245 - BUT, you must indicate in the bug report that you found the fix later in246 the series []247 - When reporting, include both the commit sha and the commit subject line []248249#### Patch series Mandatory Validation250- Was a git range provided in the prompt? [ y / n, range ]251- Did you use it to search forward? [ y / n ]252253### 15. Subsystem guide violations (hallucination check ONLY)254255Issues tagged `subsystem_guide_violation: true`, or with category256`guide-directive` or `issue_type: "potential-issue"` with a `guide_directive`257field, are subsystem guide violations. The subsystem guide is authoritative —258the violation itself is treated as factually correct.259260**STOP. For these issues, ONLY perform these three hallucination checks. Do261NOTHING else. Do NOT apply sections 1-14. Do NOT apply TASK POSITIVE.1.**2622631. **Does the cited guide rule exist?** Re-read the subsystem guide and confirm264 the quoted directive actually appears in the guide text. If the agent265 fabricated or misquoted the rule, eliminate the issue.2662672. **Does the cited code exist?** Confirm the function, variable, or code268 pattern the agent cited is real. Use `find_function` or read the file. If269 the agent hallucinated the code (wrong function name, nonexistent variable,270 fabricated code path), eliminate the issue.2712723. **Does the code actually violate the guide rule?** Read the cited code and273 the guide rule side by side. Confirm the code does the thing the guide says274 not to do (or fails to do the thing the guide requires). If the agent275 mismatched rule to code — e.g., the guide prohibits pattern X but the code276 does pattern Y, or the guide requires lock L but the code already holds277 lock L — eliminate the issue.278279**If all three checks pass, PRESERVE the issue. You are done.**280281**Explicit prohibitions for subsystem guide violations:**282- Do NOT analyze whether the bug is "real" or "theoretical"283- Do NOT check if the code "handles it gracefully"284- Do NOT evaluate locking, races, reachability, or safety285- Do NOT apply your own reasoning about whether the pattern is dangerous286- Do NOT check callers, callees, or context beyond confirming the code exists287- Do NOT debate yourself about the issue288- The ONLY reason to eliminate is hallucination: fabricated rule or fabricated code289290## TASK POSITIVE.1 Verification Checklist291292Complete each verification step below and produce the required output.293Do not skip steps. Do not claim completion without producing the output.294295Before reporting ANY regression, verify:2962970. For NULL pointer dereferences, review technical-patterns.md and load pointer-guards.md298 - Output: "reviewed" or "not applicable - not a NULL dereference issue"2991. **Can I prove this path executes?**300 - Find calling code that reaches here301 - Output: quote the call chain with locations (e.g., "caller@file:line → target@file:line")302 - Check for impossible conditions blocking the path303 - Output: list conditions checked and their evaluation304 - Verify not in dead code or disabled features305 - Output: enabled-by config option or "always enabled"3062. **Is the bad behavior structurally possible?**307 - Prove the code path exists and the triggering conditions are not structurally impossible308 - Output: step-by-step execution path with function names and locations showing the failure309 - Prove the failure mode is concrete (crash, deadlock, corruption, leak), not just "increases risk"310 - Output: the specific failure mode and triggering condition311 - NOTE: A deadlock, infinite wait, or crash that depends on runtime conditions312 (timing, memory pressure, shutdown state, allocation patterns) is a real bug313 if the code has no structural prevention (timeout, fallback wake condition,314 bounded retry). Do not dismiss these by arguing the conditions are unlikely.3153. **Did I check the full context?**316 - Examine calling functions (2-3 levels up)317 - Output: list each caller checked with a random line from each318 - Check initialization and cleanup paths319 - Output: init/cleanup functions examined with locations320 - Verify subsystem conventions321 - Output: conventions found and whether code follows them3224. **Is this actually wrong?**323 - Check if intentional design choice324 - Output: quote commit message or comment if explains intent, else "no explanation found"325 - Check if documented limitation326 - Output: quote documentation if found, else "not documented"327 - Verify not test code allowed to be imperfect328 - Output: "production code" or "test code - severity adjusted"329 - Confirm bug exists today, not just if code changes later330 - Output: current triggering path or "theoretical future issue only"331 - NOTE: "theoretical" means the code path cannot be reached today.332 A bug that depends on runtime conditions (timing, system state) is333 not theoretical — it is a real bug with a conditional trigger.3345. **Did I check the commit message and surrounding comments?**335 - Read the entire commit message336 - Output: quote any text explaining this behavior, or "no explanation found"337 - Read surrounding code comments338 - Output: quote relevant comments, or "no relevant comments"3396. **When complex multi-step conditions are required for the bug to exist**340 - Prove these conditions are actually possible341 - Output: code path showing each condition can be true simultaneously3427. **Did I hallucinate a problem that doesn't actually exist?**343 - Verify the bug report matches the actual code344 - Output: quote the exact code snippet from the file345 - Reread the file and confirm code matches your analysis346 - Output: file:line and verbatim code347 - Check your math (division by zero requires zero in denominator, etc.)348 - Output: arithmetic verification or "no arithmetic involved"3498. **Did I check for future fixes in the same patch series?**350 - Search forward in git history (not back), only on this branch351 - Output: commits checked or "no git range provided"352 - If fix found later in series353 - Output: "found fix in [commit] - reporting as real bug with later fix" or "no fix found"3549. **If dismissing based on comments or documentation, verify the implementation**355 - Did you read the actual function implementation, not just the comment?356 - Output: quote the implementation code that proves the comment is accurate357 - Does the function have #ifdef/#else branches with different behavior?358 - Output: list config options that affect behavior, state which applies359 - Did you verify helper functions behave as their comments claim?360 - Output: quote helper implementation or "no helper functions involved"361 - If you cannot verify implementation matches documentation, do NOT dismiss362 - Output: "implementation verified" or "cannot verify - reporting issue"36336410. **Debate yourself**365 - Do these two steps in order:366 - 10.1 Pretend you are the author. Think extremely hard about the review and try to prove it incorrect.367 - Check for hallucinations or invented information368 - **For NULL safety, ask as the author:**369 * Did reviewer search for similar code in my subsystem accessing this pointer?370 * If reporting missing NULL check, did they explain why OTHER code in my subsystem HAS that check?371 * Did they verify lifecycle dependencies or just analyze syntactically?372 * Is there semantic coupling between guard condition and pointer validity they missed?373 * Would adding their suggested check be redundant/paranoid given the invariants?374 * Did they compare guard patterns - why does path A check NULL but path B doesn't?375 - **For locking, ask as the author:**376 * Did reviewer check what locks my caller holds?377 * Did they understand lock context (process/softirq/hardirq/RCU)?378 * Is there a lock held higher in the call chain they missed?379 - **For resource leaks, ask as the author:**380 * Did reviewer trace ownership transfer?381 * Did they check for async cleanup mechanisms?382 * Is the resource stored somewhere for later cleanup?383 - **For all issues, ask as the author:**384 * Did they check if this is intentional based on commit message or comments?385 * Did they verify the conditions for the bug are actually possible?386 * Are they confusing a structurally possible bug with a defensive programming suggestion?387 - Output: strongest argument against reporting this bug388 - IMPORTANT: "unlikely in practice" is not a valid argument against a389 deadlock, crash, or data corruption. Only "structurally impossible"390 (the code literally cannot reach that state) is valid. See391 callstack.md "Reachability Dismissals".392 - 10.2 Now pretend you're the reviewer. Think extremely hard about the author's arguments and decide if the review is correct.393 - Address each author argument with code evidence394 - Output: code evidence refuting the author, or "cannot refute with code - likely false positive"395396### Mandatory Validation397398- If any Output requirement above is blank or skipped, repeat that step399- If you cannot produce code evidence for your conclusion, the bug is likely a false positive400401## Patch series402- You may only use this exact method to look forward in git history.403- NEVER invent other methods to look forward in git history.404- If the prompt included a range of git commits to check, look forward405 through that range for later patches that might resolve the bug you found.406- Never search backwards in commit history.407408## Special Cases409410### Test Code411- Memory leaks in test programs → Usually OK412- File descriptor leaks in tests → Usually OK413- Unless it crashes/hangs the system → Report it414415### Assertions and Warnings416- Removing WARN_ON/BUG_ON → Not a regression417- Removing BUILD_BUG_ON → Not a regression418- Unless removing critical runtime checks → Then report419420### Reverts421- When reviewing reverts, focus on new issues422- Assume the original bug is known/handled423- Don't re-report the original problem424425### Subsystem Exclusions426- fs/bcachefs → Skip all issues427- Staging drivers → Lower standards apply428- Example/test code → Focus on system impact only429430## Final Filter431432Before adding to report, think about the regression and ask:4331. **Do I have proof, not just suspicion?** [ yes / no ]434 - Code snippets showing all components required to trigger the bug count as proof435 - ONLY if the conditions are also proven to be possible436 - Existing defensive pattern checks for the same condition also count as proof.437 - ONLY if you can prove the condition can occur438 - Existing WARN_ON()/BUG_ON() don't count as proof.439 - For deadlocks/hangs: showing that a wait has no timeout and no alternative440 wake condition IS proof. You do not also need to prove the system will441 definitely enter that state.4422. **Would an expert see this as a real issue?** [ yes / no ]4433. **Is this worth the maintainer's time?** [ yes / no ]4444. **Am I suggesting defensive programming, or reporting a concrete bug?** [ yes / no ]445 - Defensive programming: "add a NULL check here for safety" → discard446 - Concrete bug: "this wait_event has no timeout and no fallback wake" → report447448### MANDATORY Final Filter validation449450If you didn't answer yes to all 4 questions, investigate further or discard451452## Remember453- **False positives waste everyone's time**454- **Missed bugs also waste everyone's time** - a deadlock in production is worse than a false positive in review455- **Kernel developers are experts** - but experts miss bugs too, especially subtle interactions between subsystems (workqueues, notifiers, shutdown ordering)456- **Real bugs have real proof** - but proof means showing the code path exists and has no structural prevention, not proving the bug will definitely fire on every execution