New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPP: Add query for CWE-675: Duplicate Operations on Resource #6588
Conversation
This looks like a useful query, but the code is a little difficult to understand at the moment.
cpp/ql/src/experimental/Security/CWE/CWE-675/DoubleRelease.qhelp
Outdated
Show resolved
Hide resolved
|
||
/** Holds if the first arguments of the two functions are similar. */ | ||
predicate similarArguments(FunctionCall fc, FunctionCall fc1) { | ||
globalValueNumber(fc.getArgument(0)) = globalValueNumber(fc1.getArgument(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This simple case looks good to me. How often do the other two cases (below) help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all situations were detected on my tests. I would like to leave these cases, also because they provide cve detection.
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Results look good to me. There may well be a performance issue with this query, but in my opinion we don't need to worry about that before merging into experimental. |
double release of descriptors can lead to an abnormal program termination.
when making a request to double free memory, I skipped the specified impact vector.
however, the situation described in CVE-2019-13351 suggests the need for such a request.
actual PR
bloomberg/comdb2#2940