Merge branch next and update CodeQL to v2.23.9 - #1154
Conversation
Observe that `sizeof(...)` might not occur as a dataflow node if it has a parent node with a concrete value. That value will be a dataflow node instead. Hence, the query has be changed to check for expressions where `sizeof(...)` is a child of an expression with a concrete value.
Note that we now properly report the offending cast instead of the expression that is being cast.
As it is the dataflow used by `asctime` that is relevant, and not the pointer, use the indirect expression.
These use the new dataflow library
Since the new dataflow library uses use-use dataflow and not def-use dataflow, we now need to check for definitions. Note that these queries can probably be improved by using a dataflow configuration - possibly limited to the local context of a function by including `DataFlow::FeatureEqualSourceSinkCallContext`
…ataflow library" This reverts commit b18c7b4. This change broke some tests.
b5970a4 to
d66ec8d
Compare
Co-authored-by: mbaluda <5237080+mbaluda@users.noreply.github.com>
|
/test-performance |
|
🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute. |
|
/test-performance |
|
🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute. |
|
🏁 Beep Boop! Performance testing complete! See below for performance of the last 3 runs vs your PR. Times are based on predicate performance. You can find full graphs and stats in the PR that was created for this test in the release engineering repo. 🏁 Below are the slowest predicates for the last 2 releases vs this PR. |
Description
Upgrades
codeql/cpp-alland related CodeQL dependencies, migrating queries and shared libraries off the deprecatedsemmle.code.cpp.dataflow.DataFlow/TaintTrackingmodules andcodingstandards.cpp.Concurrencyonto theirnew/ConcurrencyNewreplacements. This is a mechanical, repo-wide migration touching ~90 rules; most changes are import swaps only, with dataflow-node API updates (asIndirectExpr(),asDefiningArgument(),isBarrierIn, etc.) where required by the new library.Four regressions were found and fixed, with matching test coverage:
RULE-1-2: false negative for_Decimal32/_Decimal64/_Decimal128compiler-extension detection.ENV30-C/RULE-21-19/RULE-25-5-2(ConstLikeReturnValueshared query): duplicate alert on the same pointer write.INT31-C: false positive on the standard-permitted(time_t)-1conversion.RULE-14-3: false negative where an always-false compound loop condition (e.g.1 == 0 && p1 > 12) was incorrectly treated as a permitted literal-0exception.Modified rules:
RULE-1-2,ENV30-C,RULE-21-19,RULE-25-5-2,INT31-C,RULE-14-3ARR39-C,CON30-C,CON34-C,EXP16-C,EXP37-C,FIO44-C,MSC33-C,RULE-17-5,RULE-21-14,A15-2-2,A20-8-4,A5-1-7,M9-3-1,CTR55-CPP,MEM52-CPP.These updates include changes from the
nextbranch to maintain compatibility with the evolving CodeQL ecosystem.Change request type
.ql,.qll,.qlsor unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.