microsoft / microsoft/usersim

Perform deepcopy in WdfDeviceInitAssignName

Open
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
105
Forks
34
Avg merge
3d 39m
Merged PRs (30d)
5

Description

Right now _WdfDeviceInitAssignName is holding on to the driver supplied name and saves it as device_name. However, the device_name buffer supplied to this routine may be freed after the call to _WdfDeviceInitAssignName (or subsequent call to _WdfDeviceCreate) since it's owned by the caller. A deep copy of the supplied device_name would mitigate this use-after-free issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at _WdfDeviceInitAssignName and inspect how the caller-supplied device_name is stored. Confirm that the stored device name remains valid after the caller frees its buffer, including after _WdfDeviceCreate.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.