Skip to content

Go: Add models for go 1.21 - #22797

Merged
owen-mc merged 4 commits into
github:mainfrom
owen-mc:go/model-go1.21-minor-library-changes
Nov 26, 2026
Merged

owen-mc merged 4 commits into
github:mainfrom
owen-mc:go/model-go1.21-minor-library-changes

Conversation

@owen-mc

@owen-mc owen-mc commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Copilot AI balanced review requested due to automatic review settings October 9, 2026 14:51
@owen-mc
owen-mc requested a review from a team as a code owner October 9, 2026 14:51
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

go

Generated file changes for go

  • Changes to framework-coverage-go.rst:
-    `Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``, ``weak``",52,674,127
+    `Standard library <https://pkg.go.dev/std>`_,"````, ``archive/*``, ``bufio``, ``bytes``, ``cmp``, ``compress/*``, ``container/*``, ``context``, ``crypto``, ``crypto/*``, ``database/*``, ``debug/*``, ``embed``, ``encoding``, ``encoding/*``, ``errors``, ``expvar``, ``flag``, ``fmt``, ``go/*``, ``hash``, ``hash/*``, ``html``, ``html/*``, ``image``, ``image/*``, ``index/*``, ``io``, ``io/*``, ``log``, ``log/*``, ``maps``, ``math``, ``math/*``, ``mime``, ``mime/*``, ``net``, ``net/*``, ``os``, ``os/*``, ``path``, ``path/*``, ``plugin``, ``reflect``, ``reflect/*``, ``regexp``, ``regexp/*``, ``slices``, ``sort``, ``strconv``, ``strings``, ``sync``, ``sync/*``, ``syscall``, ``syscall/*``, ``testing``, ``testing/*``, ``text/*``, ``time``, ``time/*``, ``unicode``, ``unicode/*``, ``unsafe``, ``weak``",52,696,127
-    Totals,,690,1134,1580
+    Totals,,690,1156,1580
  • Changes to framework-coverage-go.csv:
- context,,,5,,,,,,,,,,,,,,,,,,,,,,,5,
+ context,,,10,,,,,,,,,,,,,,,,,,,,,,,10,
- crypto,,,10,,,,,,,,,,,,,,,,,,,,,,,10,
+ crypto,,,24,,,,,,,,,,,,,,,,,,,,,,,24,
- io,5,4,34,,,,,,5,,,,,,,,,,,,,,4,,,34,
+ io,5,4,36,,,,,,5,,,,,,,,,,,,,,4,,,36,
- math/big,,,1,,,,,,,,,,,,,,,,,,,,,,,1,
+ math/big,,,2,,,,,,,,,,,,,,,,,,,,,,,2,

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The TLS summaries currently introduce false-positive flows from unused ConnectionState arguments.

4 open findings
What changed in this PR

Adds Go 1.21 standard-library data-flow models and corresponding regression coverage.

Changes:

  • Models new context, crypto/tls, io/fs, and math/big APIs.
  • Adds taint-flow fixtures and a change note.
File Description
go/​ql/​lib/​ext/​context.model.yml Models new context APIs.
go/​ql/​lib/​ext/​crypto.tls.model.yml Models TLS session and QUIC APIs.
go/​ql/​lib/​ext/​io.fs.model.yml Models filesystem formatting functions.
go/​ql/​lib/​ext/​math.big.model.yml Models Int.Float64.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​StdlibTaintFlow/​Context.go Tests context summaries.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​StdlibTaintFlow/​CryptoTls.go Tests TLS summaries.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​StdlibTaintFlow/​IoFs.go Tests filesystem summaries.
go/​ql/​test/​library-tests/​semmle/​go/​frameworks/​StdlibTaintFlow/​MathBig.go Tests Int.Float64.
go/​ql/​src/​change-notes/​2026-09-30-model-go1.21-minor-library-changes.md Documents the analysis improvement.
Files not reviewed (2)
  • go/ql/test/library-tests/semmle/go/frameworks/StdlibTaintFlow/Context.go: Generated file
  • go/ql/test/library-tests/semmle/go/frameworks/StdlibTaintFlow/CryptoTls.go: Generated file

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go/ql/lib/ext/crypto.tls.model.yml Resolved
Comment thread go/ql/lib/ext/crypto.tls.model.yml Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@owen-mc
owen-mc force-pushed the go/model-go1.21-minor-library-changes branch from b89c8f4 to 1b8dc00 Compare November 18, 2026 16:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
michaelnebel
michaelnebel previously approved these changes Nov 25, 2026

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Perhaps, run DCA before merging?

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active modeling gaps lose taint through TLS fields, context cause retrieval, and filesystem name formatting, leaving relevant flows untracked and needing targeted fixes and regression tests.

5 open issues
4 resolved since last review

Review effort: Max

Comment thread go/ql/lib/ext/context.model.json Resolved
Comment thread go/ql/lib/ext/crypto.tls.model.json Resolved
Comment thread go/ql/lib/ext/crypto.tls.model.json Resolved
Comment thread go/ql/lib/ext/crypto.tls.model.json Resolved
Comment thread go/ql/lib/ext/io.fs.model.json Resolved
@owen-mc
owen-mc requested a review from michaelnebel November 25, 2026 11:20
@@ -0,0 +1,4 @@
reverseRead
| CryptoTls.go:66:23:66:27 | implicit-deref state | Origin of readStep is missing a PostUpdateNode. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning to address these consistency failures?

@owen-mc owen-mc Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in this PR. It's a pre-existing problem that's out of scope for adding these models. But thanks for the prod - I'll have a look into addressing it in a separate PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a draft PR #23245 to fix those consistency test results. I'll update it after this has merged, and then run DCA and QA, as it might lead to a lot more results, if this lack of post-update nodes was stopping flow.

@owen-mc

owen-mc commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

DCA looks totally neutral.

@owen-mc
owen-mc requested a review from michaelnebel November 26, 2026 10:01

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@owen-mc
owen-mc merged commit 5655386 into github:main Nov 26, 2026
14 checks passed
@owen-mc
owen-mc deleted the go/model-go1.21-minor-library-changes branch November 26, 2026 12:32
@owen-mc owen-mc mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants