ProcThreadAttributeListBuilder::attribute should be unsafe
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
This function has an explicit note saying that it can cause UB, yet it is safe.
As I understand it, e.g. setting PROC_THREAD_ATTRIBUTE_PARENT_PROCESS to a random pointer value will cause UB.
Furthermore, setting an incorrectly-sized field to an attribute (e.g. setting a usize to PROC_THREAD_ATTRIBUTE_SECURITY_CAPABILITIES will read to reading from stack memory.
This should probably be unsafe and have proper safety documentation
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ProcThreadAttributeListBuilder::attribute API and its implementation, linked in the issue. Review how attribute values and sizes are passed to Windows, then check existing tests or documentation for this API. Done means the safety requirement is accurately represented in the API and its safety documentation explains the invalid-value cases described here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100