Skip to content

futures_task::waker_ref() is unsound #2795

@js2xxx

Description

@js2xxx

The requirements of futures_task::waker(a) and futures_task::waker_ref(&a) for all a should be the same. However in the current implementation, the former requires a to be 'static, while the latter does not. This enables a static Waker to be obtained from a non-static a, resulting in some potential use-after-free problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-taskArea: futures::taskbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions