Merge pull request #22445 from github/hvitved-add-source-sink-barrier… · microsoft/codeql@b0fa3e7 · GitHub
Skip to content

Commit b0fa3e7

Browse files
authored
Merge pull request github#22445 from github/hvitved-add-source-sink-barrier-tests
Rust: Source/sink/barrier MaD trait models apply to implementations
2 parents 6b3497b + 2d69fc3 commit b0fa3e7

27 files changed

Lines changed: 917 additions & 542 deletions

File tree

‎cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll‎

Lines changed: 10 additions & 10 deletions

‎csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,10 @@ module Input implements InputSig<Location, DataFlowImplSpecific::CsharpDataFlow>
3030
)
3131
}
3232

33-
class SourceBase extends Void {
33+
class FlowSummaryCallBase extends Void {
3434
Location getLocation() { none() }
3535
}
3636

37-
class SinkBase = SourceBase;
38-
39-
class FlowSummaryCallBase = SourceBase;
40-
4137
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {
4238
result.asSummarizedCallable() = c
4339
}

‎go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ module Input implements InputSig<Location, DataFlowImplSpecific::GoDataFlow> {
2727

2828
class SummarizedCallableBase = Callable;
2929

30-
class SourceBase extends Void {
30+
class FlowSummaryCallBase extends Void {
3131
Location getLocation() { none() }
3232
}
3333

34-
class SinkBase = SourceBase;
35-
36-
class FlowSummaryCallBase = SourceBase;
37-
3834
predicate callableFromSource(SummarizedCallableBase c) { exists(c.getFuncDef()) }
3935

4036
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {

‎java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ module Input implements InputSig<Location, DataFlowImplSpecific::JavaDataFlow> {
3737
sc.asCallable() = any(Callable c | c.fromSource() and not c.isStub())
3838
}
3939

40-
class SourceBase extends Void {
40+
class FlowSummaryCallBase extends Void {
4141
Location getLocation() { none() }
4242
}
4343

44-
class SinkBase = SourceBase;
45-
46-
class FlowSummaryCallBase = SourceBase;
47-
4844
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {
4945
result.asSummarizedCallable() = c
5046
}

‎javascript/ql/lib/semmle/javascript/dataflow/internal/FlowSummaryPrivate.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@ class SummarizedCallableBase extends string {
2424
Location getLocation() { none() }
2525
}
2626

27-
class SourceBase extends Void {
27+
class FlowSummaryCallBase extends Void {
2828
Location getLocation() { none() }
2929
}
3030

31-
class SinkBase = SourceBase;
32-
33-
class FlowSummaryCallBase = SourceBase;
34-
3531
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {
3632
result.asLibraryCallable() = c
3733
}

‎python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@ module Input implements InputSig<Location, DataFlowImplSpecific::PythonDataFlow>
2121
Location getLocation() { none() }
2222
}
2323

24-
class SourceBase extends Void {
24+
class FlowSummaryCallBase extends Void {
2525
Location getLocation() { none() }
2626
}
2727

28-
class SinkBase = SourceBase;
29-
30-
class FlowSummaryCallBase = SourceBase;
31-
3228
predicate callableFromSource(SummarizedCallableBase c) { none() }
3329

3430
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {

‎ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ module Input implements InputSig<Location, DataFlowImplSpecific::RubyDataFlow> {
2020
Location getLocation() { result instanceof EmptyLocation }
2121
}
2222

23-
class SourceBase extends Void {
23+
class FlowSummaryCallBase extends Void {
2424
Location getLocation() { none() }
2525
}
2626

27-
class SinkBase = SourceBase;
28-
29-
class FlowSummaryCallBase = SourceBase;
30-
3127
predicate callableFromSource(SummarizedCallableBase c) { none() }
3228

3329
DataFlowCallable getSummarizedCallableAsDataFlowCallable(SummarizedCallableBase c) {

‎rust/ql/lib/codeql/rust/dataflow/FlowBarrier.qll‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ module FlowBarrier {
4444
Range() { any() }
4545

4646
override predicate isBarrier(
47-
string output, string kind, Impl::Public::Provenance provenance, string model
47+
string output, string kind, Impl::Public::Provenance provenance, boolean isExact, string model
4848
) {
49-
this.isBarrier(output, kind) and provenance = "manual" and model = ""
49+
this.isBarrier(output, kind) and provenance = "manual" and isExact = true and model = ""
5050
}
5151

5252
/**
@@ -67,9 +67,13 @@ module FlowBarrierGuard {
6767
Range() { any() }
6868

6969
override predicate isBarrierGuard(
70-
string input, string branch, string kind, Impl::Public::Provenance provenance, string model
70+
string input, string branch, string kind, Impl::Public::Provenance provenance,
71+
boolean isExact, string model
7172
) {
72-
this.isBarrierGuard(input, branch, kind) and provenance = "manual" and model = ""
73+
this.isBarrierGuard(input, branch, kind) and
74+
provenance = "manual" and
75+
isExact = true and
76+
model = ""
7377
}
7478

7579
/**

‎rust/ql/lib/codeql/rust/dataflow/FlowSink.qll‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ module FlowSink {
3636
Range() { any() }
3737

3838
override predicate isSink(
39-
string input, string kind, Impl::Public::Provenance provenance, string model
39+
string input, string kind, Impl::Public::Provenance provenance, boolean isExact, string model
4040
) {
41-
this.isSink(input, kind) and provenance = "manual" and model = ""
41+
this.isSink(input, kind) and provenance = "manual" and isExact = true and model = ""
4242
}
4343

4444
/**

‎rust/ql/lib/codeql/rust/dataflow/FlowSource.qll‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)