Skip to content

Predicate "asDefiningArgument()" does not work for "kfree()" in C/C++ Analysis #9789

Closed
@kanxiao

Description

@kanxiao

I'm conducting security analysis of Linux drivers using the TaintAnalysis functionality of CodeQL. However, CodeQL seems cannot be able to apply the predicate asDefiningArgument() to the kernel function kfree().

When I take a Quick Evaluation of the ql snippet below, I cannot get any results.
exists(FunctionCall call | arg.asDefiningArgument() = call.getArgument(0) and call.getTarget().getName() = "kfree")

Meanwhile, I I take a Quick Evaluation of the ql snippet below, lots of results displayed.
exists(FunctionCall call | arg.asExpr() = call.getArgument(0) and call.getTarget().getName() = "kfree")

Did I do something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C++questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions