Skip to content

Commit 52ce0ef

Browse files
committed
C++: mass enable diff-informed data flow
An auto-generated patch that enables diff-informed data flow in the obvious cases. Builds on #18342 and github/codeql-patch#88
1 parent 8fe2699 commit 52ce0ef

File tree

12 files changed

+24
-0
lines changed

12 files changed

+24
-0
lines changed

cpp/ql/lib/experimental/semmle/code/cpp/security/PrivateCleartextWrite.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ module PrivateCleartextWrite {
4242
predicate isSink(DataFlow::Node sink) { sink instanceof Sink }
4343

4444
predicate isBarrier(DataFlow::Node node) { node instanceof Sanitizer }
45+
46+
predicate observeDiffInformedIncrementalMode() { any() }
4547
}
4648

4749
module WriteFlow = TaintTracking::Global<WriteConfig>;

cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ module CastToPointerArithFlowConfig implements DataFlow::StateConfigSig {
4848
predicate isBarrierIn(DataFlow::Node node) { isSource(node, _) }
4949

5050
predicate isBarrierOut(DataFlow::Node node) { isSink(node, _) }
51+
52+
predicate observeDiffInformedIncrementalMode() { any() }
5153
}
5254

5355
/**

cpp/ql/src/Likely Bugs/Memory Management/NtohlArrayNoBound.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ private module NetworkToBufferSizeConfig implements DataFlow::ConfigSig {
141141
gc.controls(node.asExpr().getBasicBlock(), _)
142142
)
143143
}
144+
145+
predicate observeDiffInformedIncrementalMode() { any() }
144146
}
145147

146148
module NetworkToBufferSizeFlow = DataFlow::Global<NetworkToBufferSizeConfig>;

cpp/ql/src/Security/CWE/CWE-114/UncontrolledProcessOperation.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ module Config implements DataFlow::ConfigSig {
3939
or
4040
node.asCertainDefinition().getUnspecifiedType() instanceof ArithmeticType
4141
}
42+
43+
predicate observeDiffInformedIncrementalMode() { any() }
4244
}
4345

4446
module Flow = TaintTracking::Global<Config>;

cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ module ImproperArrayIndexValidationConfig implements DataFlow::ConfigSig {
6666
not offsetIsAlwaysInBounds(arrayExpr, offsetExpr)
6767
)
6868
}
69+
70+
predicate observeDiffInformedIncrementalMode() { any() }
6971
}
7072

7173
module ImproperArrayIndexValidation = TaintTracking::Global<ImproperArrayIndexValidationConfig>;

cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ module Config implements DataFlow::ConfigSig {
4444
or
4545
isArithmeticNonCharType(node.asCertainDefinition().getUnspecifiedType())
4646
}
47+
48+
predicate observeDiffInformedIncrementalMode() { any() }
4749
}
4850

4951
module Flow = TaintTracking::Global<Config>;

cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ module Config implements DataFlow::ConfigSig {
9494
not iTo instanceof PointerArithmeticInstruction
9595
)
9696
}
97+
98+
predicate observeDiffInformedIncrementalMode() { any() }
9799
}
98100

99101
module Flow = TaintTracking::Global<Config>;

cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ module ExposedSystemDataConfig implements DataFlow::ConfigSig {
3434
predicate isBarrier(DataFlow::Node node) {
3535
node.asIndirectArgument() = any(MemsetFunction func).getACallToThisFunction().getAnArgument()
3636
}
37+
38+
predicate observeDiffInformedIncrementalMode() { any() }
3739
}
3840

3941
module ExposedSystemData = TaintTracking::Global<ExposedSystemDataConfig>;

cpp/ql/src/Security/CWE/CWE-497/PotentiallyExposedSystemData.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ module PotentiallyExposedSystemDataConfig implements DataFlow::ConfigSig {
5454
predicate isBarrier(DataFlow::Node node) {
5555
node.asIndirectArgument() = any(MemsetFunction func).getACallToThisFunction().getAnArgument()
5656
}
57+
58+
predicate observeDiffInformedIncrementalMode() { any() }
5759
}
5860

5961
module PotentiallyExposedSystemData = TaintTracking::Global<PotentiallyExposedSystemDataConfig>;

cpp/ql/src/Security/CWE/CWE-611/XXE.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ module XxeConfig implements DataFlow::StateConfigSig {
4545
}
4646

4747
predicate neverSkip(DataFlow::Node node) { none() }
48+
49+
predicate observeDiffInformedIncrementalMode() { any() }
4850
}
4951

5052
module XxeFlow = DataFlow::GlobalWithState<XxeConfig>;

cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ module WordexpTaintConfig implements DataFlow::ConfigSig {
4848
predicate isBarrier(DataFlow::Node node) {
4949
node.asExpr().getUnspecifiedType() instanceof IntegralType
5050
}
51+
52+
predicate observeDiffInformedIncrementalMode() { any() }
5153
}
5254

5355
module WordexpTaint = TaintTracking::Global<WordexpTaintConfig>;

cpp/ql/src/experimental/Security/CWE/CWE-190/AllocMultiplicationOverflow.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ module MultToAllocConfig implements DataFlow::ConfigSig {
3030
// something that affects an allocation size
3131
node.asExpr() = any(HeuristicAllocationExpr ae).getSizeExpr().getAChild*()
3232
}
33+
34+
predicate observeDiffInformedIncrementalMode() { any() }
3335
}
3436

3537
module MultToAlloc = DataFlow::Global<MultToAllocConfig>;

0 commit comments

Comments
 (0)