fix(detector): catch function-attribute replay#16
Closed
WazupSteve wants to merge 1 commit into
Closed
Conversation
KernelGuard Blue Evaluation
|
Author
|
Withdrawing this PR because the associated Flywheel static red attempts were removed as unproven/out-of-scope for the campaign GPU-kernel work. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targets red #18 (
function-attribute flag replay). Livekernelguard==0.2.2classified the exploit asvalidbecause replay state is stored directly on thecustom_kernelfunction object rather than in module globals, captured dict/object state, or a cache-named container:The fast path ignores the input and returns a saved output, but the existing flag/counter detector only covers
globaldeclarations. This patch adds a narrowLAST_CALL_REPLAYpass for entrypoint-object attributes.Approach
Within the configured entrypoint, collect attributes assigned on the entrypoint function object itself, for example
custom_kernel.out = .... Then flag anifbranch only when:This keeps callable/compiled-kernel caches and lazy buffer initialization out of scope because they either call through the cached object or do not return a saved entrypoint attribute from a call-free fast path.
KernelGuard-Red-Submission: 18
Test plan
red18_function_attr_flag->LAST_CALL_REPLAY,should_filter=Trueplain_kernel-> staysvalidfunction_attr_callable_cache_legit-> staysvalidfunction_attr_buffer_init_legit-> staysvalidfunction_attr_shape_dispatch_legit-> staysvalidpython3 -m py_compile kernelguard.py