Skip to content

C++: Add more thread creation models #20016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 10, 2025

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Jul 10, 2025

This is #19955, but for pthreads and std::threads.

Commit-by-commit review recommended.

@Copilot Copilot AI review requested due to automatic review settings July 10, 2025 11:50
@MathiasVP MathiasVP requested a review from a team as a code owner July 10, 2025 11:50
@github-actions github-actions bot added the C++ label Jul 10, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds thread creation models for pthread and std::thread APIs to track data flow when arguments are passed to thread functions. The purpose is to improve CodeQL's ability to detect security vulnerabilities and data flow issues across thread boundaries.

  • Adds data flow models for std::thread constructor to track parameter passing
  • Adds data flow model for pthread_create function to track argument passing to thread functions
  • Includes comprehensive test cases demonstrating taint flow through thread creation

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
thread.cpp New test file demonstrating taint flow through std::thread creation
test.cpp Added pthread_create test case showing taint flow to thread function
std.thread.model.yml Data flow models for std::thread constructor parameter passing
pthread.model.yml Data flow model for pthread_create argument passing
stl.h Added std::thread class definition for testing
*.expected Updated test expectations reflecting new thread models

Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

Small nit, other than this LGTM if DCA is happy.

Co-authored-by: Jeroen Ketema <93738568+jketema@users.noreply.github.com>
jketema
jketema previously approved these changes Jul 10, 2025
@MathiasVP MathiasVP merged commit fefb35b into github:main Jul 10, 2025
15 checks passed
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy