Implement ops_edges CodeQL query for kernel indirect ops call targets - #420
Open
artmetla wants to merge 1 commit into
Open
Implement ops_edges CodeQL query for kernel indirect ops call targets#420artmetla wants to merge 1 commit into
artmetla wants to merge 1 commit into
Conversation
Implement ops_edges.ql to resolve indirect call sites (ExprCall) invoking
function-pointer struct fields to concrete callback implementations registered in
kernel ops initializers.
Key changes:
* Implement queries/ops_edges.ql with the 11-column projection expected by
import_ops_targets.py and the dashboard reachability viewer.
* Model kernel ops registrations using OpsAggregateLiteral (ClassAggregateLiteral
with FunctionPointerIshType) matching both FunctionAccess and AddressOfExpr
assignments via .getUnconverted() to handle typecasts.
* Bind indirect call invocations (ec.getExpr() = field.getAnAccess()) to enclosing
caller function spans and target function definition bodies.
* Add locationString helper to render standard 5-part definition coordinates
(file:startLine:startColumn:endLine:endColumn).
* Filter entities with empty identifiers or missing function bodies to ensure valid
integer line spans.
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.
Implements queries/ops_edges.ql to resolve indirect kernel call sites (ExprCall) to concrete callback implementations registered in ops structures (e.g., file_operations, device_attribute). It outputs the 11-column projection expected by import_ops_targets.py to populate the ops_targets table in codeql_data.db.