Skip to content

[Bug]: Re-evaluate TPL/Atomic Sequencing #1667

Description

@joschock

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

The present ordering of TplMutex acquire is:

set atomic lock = true
<preemption window>
raise TPL_NOTIFY

and release is:

restore previous/lower TPL
<queued callbacks may run here>
set atomic lock = false

This means that there is a window where event handlers running at a callback equal to the lock level (which would normally be prevented by the TPL raise can observe the Mutex as Locked (due to the atomic). This could lead to re-entrancy/deadlock.

Expected Behavior

It should not be possible for a callback at or below the TplMutex lock level to observe the Mutex as locked().

Steps To Reproduce

By inspection.

Build Environment

- OS(s):
- Targets Impacted:
N/A

Version Information

Commit: 517de6ea31857538d65c2fedf39d24fa1fb2b1ba

Urgency

Medium

Are you going to fix this?

I will fix it

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

Metadata

Metadata

Assignees

Labels

state:needs-maintainer-feedbackNeeds more information from a maintainer to determine next stepsstate:needs-triageNeeds to triaged to determine next stepstype:bugSomething isn't workingurgency:mediumImportant with a moderate impact

Type

No type

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions