Skip to content
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

Insufficient memory reordering protection in spsc::Queue::push and spsc::Queue::pop #119

Closed
elBoberido opened this issue Feb 18, 2024 · 0 comments · Fixed by #122
Closed
Assignees
Labels
bug Something isn't working

Comments

@elBoberido
Copy link
Member

Required information

Operating system:
all

Rust version:
all

Cargo version:
all

iceoryx2 version:
main branch

Observed result or behaviour:

The data access is not sufficiently protected against a reordering with read_position. While there is a AqcRel fence, the fence has no counterpart to synchronize with. This can be fixed by replacing the fence with a store on read_position with Ordering::Release in pop and a load with Ordering::Acquire in push.

Expected result or behaviour:

The data array is protected against reordering.

Conditions where it occurred / Performed steps:

It can happen whenever the CPU reorders the instructions.

@elBoberido elBoberido added the bug Something isn't working label Feb 18, 2024
@elBoberido elBoberido added this to the lock-free hardening milestone Feb 18, 2024
@elBoberido elBoberido self-assigned this Feb 18, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 18, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 18, 2024
elBoberido added a commit to elBoberido/iceoryx2 that referenced this issue Feb 18, 2024
elBoberido added a commit that referenced this issue Feb 19, 2024
…spsc-queue

[#119] Fix memory order issue in 'Queue'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant