-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
C++: Add more thread creation models #20016
Conversation
There was a problem hiding this 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 |
There was a problem hiding this 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>
This is #19955, but for
pthread
s andstd::thread
s.Commit-by-commit review recommended.