Skip to content

Commit

Permalink
Merge pull request #16558 from owen-mc/go/sync-external-flow
Browse files Browse the repository at this point in the history
Go: sync ExternalFlow.qll
  • Loading branch information
owen-mc authored Jun 5, 2024
2 parents ff46e2c + cbbdd01 commit 44a56c4
Show file tree
Hide file tree
Showing 177 changed files with 932 additions and 687 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
category: feature
---
* When writing models-as-data models, the receiver is now referred to as `Argument[receiver]` rather than `Argument[-1]`.
* Neutral models are now supported. They have no effect except that a manual neutral summary model will stop a generated summary model from having any effect.
6 changes: 3 additions & 3 deletions go/ql/lib/ext/archive.tar.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ extensions:
data:
- ["archive/tar", "", False, "FileInfoHeader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["archive/tar", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["archive/tar", "Header", True, "FileInfo", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["archive/tar", "Reader", True, "Next", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["archive/tar", "Writer", True, "WriteHeader", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["archive/tar", "Header", True, "FileInfo", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["archive/tar", "Reader", True, "Next", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["archive/tar", "Writer", True, "WriteHeader", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
6 changes: 3 additions & 3 deletions go/ql/lib/ext/archive.zip.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ extensions:
- ["archive/zip", "", False, "FileInfoHeader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "", False, "OpenReader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "File", True, "Open", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "File", True, "OpenRaw", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "Writer", True, "Copy", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["archive/zip", "File", True, "Open", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "File", True, "OpenRaw", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["archive/zip", "Writer", True, "Copy", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
18 changes: 9 additions & 9 deletions go/ql/lib/ext/bufio.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ extensions:
- ["bufio", "", False, "ScanLines", "", "", "Argument[0]", "ReturnValue[1]", "taint", "manual"]
- ["bufio", "", False, "ScanRunes", "", "", "Argument[0]", "ReturnValue[1]", "taint", "manual"]
- ["bufio", "", False, "ScanWords", "", "", "Argument[0]", "ReturnValue[1]", "taint", "manual"]
- ["bufio", "Reader", True, "Peek", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadBytes", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadLine", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadSlice", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadString", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["bufio", "Scanner", True, "Bytes", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["bufio", "Scanner", True, "Text", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["bufio", "Writer", True, "Reset", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["bufio", "Reader", True, "Peek", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadBytes", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadLine", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadSlice", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "ReadString", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bufio", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["bufio", "Scanner", True, "Bytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["bufio", "Scanner", True, "Text", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["bufio", "Writer", True, "Reset", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
10 changes: 5 additions & 5 deletions go/ql/lib/ext/bytes.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ extensions:
- ["bytes", "", False, "TrimRightFunc", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["bytes", "", False, "TrimSpace", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["bytes", "", False, "TrimSuffix", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["bytes", "Buffer", True, "Bytes", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["bytes", "Buffer", True, "Next", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["bytes", "Buffer", True, "ReadBytes", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bytes", "Buffer", True, "ReadString", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["bytes", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["bytes", "Buffer", True, "Bytes", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["bytes", "Buffer", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["bytes", "Buffer", True, "ReadBytes", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bytes", "Buffer", True, "ReadString", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["bytes", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
4 changes: 2 additions & 2 deletions go/ql/lib/ext/compress.flate.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ extensions:
data:
- ["compress/flate", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["compress/flate", "", False, "NewReaderDict", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["compress/flate", "Resetter", True, "Reset", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["compress/flate", "Writer", True, "Reset", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["compress/flate", "Resetter", True, "Reset", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["compress/flate", "Writer", True, "Reset", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
4 changes: 2 additions & 2 deletions go/ql/lib/ext/compress.gzip.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ extensions:
extensible: summaryModel
data:
- ["compress/gzip", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["compress/gzip", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["compress/gzip", "Writer", True, "Reset", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["compress/gzip", "Reader", True, "Reset", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["compress/gzip", "Writer", True, "Reset", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
4 changes: 2 additions & 2 deletions go/ql/lib/ext/compress.zlib.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ extensions:
data:
- ["compress/zlib", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["compress/zlib", "", False, "NewReaderDict", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["compress/zlib", "Resetter", True, "Reset", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["compress/zlib", "Writer", True, "Reset", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["compress/zlib", "Resetter", True, "Reset", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["compress/zlib", "Writer", True, "Reset", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
4 changes: 2 additions & 2 deletions go/ql/lib/ext/container.heap.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ extensions:
- ["container/heap", "", False, "Pop", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/heap", "", False, "Push", "", "", "Argument[1]", "Argument[0]", "taint", "manual"]
- ["container/heap", "", False, "Remove", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/heap", "Interface", True, "Pop", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/heap", "Interface", True, "Push", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/heap", "Interface", True, "Pop", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/heap", "Interface", True, "Push", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
30 changes: 15 additions & 15 deletions go/ql/lib/ext/container.list.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ extensions:
pack: codeql/go-all
extensible: summaryModel
data:
- ["container/list", "Element", True, "Next", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/list", "Element", True, "Prev", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Back", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Front", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Init", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "InsertAfter", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "Element", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/list", "Element", True, "Prev", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Back", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Front", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "Init", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "InsertAfter", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "InsertAfter", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "InsertBefore", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "InsertBefore", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "InsertBefore", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "MoveAfter", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "MoveBefore", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "MoveToBack", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "MoveToFront", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "PushBack", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "MoveAfter", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "MoveBefore", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "MoveToBack", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "MoveToFront", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "PushBack", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "PushBack", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "PushBackList", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "PushFront", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "PushBackList", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "PushFront", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "PushFront", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/list", "List", True, "PushFrontList", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["container/list", "List", True, "PushFrontList", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["container/list", "List", True, "Remove", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
8 changes: 4 additions & 4 deletions go/ql/lib/ext/container.ring.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extensions:
extensible: summaryModel
data:
- ["container/ring", "Ring", True, "Link", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Move", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Next", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Prev", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Unlink", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Move", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Next", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Prev", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
- ["container/ring", "Ring", True, "Unlink", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
2 changes: 1 addition & 1 deletion go/ql/lib/ext/context.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ extensions:
- ["context", "", False, "WithDeadline", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["context", "", False, "WithTimeout", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["context", "", False, "WithValue", "", "", "Argument[0..2]", "ReturnValue", "taint", "manual"]
- ["context", "Context", True, "Value", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["context", "Context", True, "Value", "", "", "Argument[receiver]", "ReturnValue", "taint", "manual"]
2 changes: 1 addition & 1 deletion go/ql/lib/ext/database.sql.driver.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ extensions:
- ["database/sql/driver", "Conn", True, "Prepare", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql/driver", "ConnPrepareContext", True, "PrepareContext", "", "", "Argument[1]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql/driver", "ValueConverter", True, "ConvertValue", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql/driver", "Valuer", True, "Value", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql/driver", "Valuer", True, "Value", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
2 changes: 1 addition & 1 deletion go/ql/lib/ext/database.sql.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ extensions:
- ["database/sql", "Conn", True, "PrepareContext", "", "", "Argument[1]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql", "DB", True, "Prepare", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql", "DB", True, "PrepareContext", "", "", "Argument[1]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql", "Scanner", True, "Scan", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["database/sql", "Scanner", True, "Scan", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["database/sql", "Tx", True, "Prepare", "", "", "Argument[0]", "ReturnValue[0]", "taint", "manual"]
- ["database/sql", "Tx", True, "PrepareContext", "", "", "Argument[1]", "ReturnValue[0]", "taint", "manual"]
4 changes: 4 additions & 0 deletions go/ql/lib/ext/empty.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ extensions:
pack: codeql/go-all
extensible: summaryModel
data: []
- addsTo:
pack: codeql/go-all
extensible: neutralModel
data: []
8 changes: 4 additions & 4 deletions go/ql/lib/ext/encoding.csv.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extensions:
extensible: summaryModel
data:
- ["encoding/csv", "", False, "NewReader", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["encoding/csv", "Reader", True, "Read", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["encoding/csv", "Reader", True, "ReadAll", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["encoding/csv", "Writer", True, "Write", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["encoding/csv", "Writer", True, "WriteAll", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["encoding/csv", "Reader", True, "Read", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["encoding/csv", "Reader", True, "ReadAll", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
- ["encoding/csv", "Writer", True, "Write", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["encoding/csv", "Writer", True, "WriteAll", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
12 changes: 6 additions & 6 deletions go/ql/lib/ext/encoding.gob.model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ extensions:
extensible: summaryModel
data:
- ["encoding/gob", "", False, "NewDecoder", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["encoding/gob", "Decoder", True, "Decode", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["encoding/gob", "Decoder", True, "DecodeValue", "", "", "Argument[-1]", "Argument[0]", "taint", "manual"]
- ["encoding/gob", "Encoder", True, "Encode", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["encoding/gob", "Encoder", True, "EncodeValue", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["encoding/gob", "GobDecoder", True, "GobDecode", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["encoding/gob", "GobEncoder", True, "GobEncode", "", "", "Argument[-1]", "ReturnValue[0]", "taint", "manual"]
- ["encoding/gob", "Decoder", True, "Decode", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
- ["encoding/gob", "Decoder", True, "DecodeValue", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
- ["encoding/gob", "Encoder", True, "Encode", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["encoding/gob", "Encoder", True, "EncodeValue", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["encoding/gob", "GobDecoder", True, "GobDecode", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
- ["encoding/gob", "GobEncoder", True, "GobEncode", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
Loading

0 comments on commit 44a56c4

Please sign in to comment.