Page MenuHomeFreeBSD

buf_ring: Ensure correct ordering of loads
ClosedPublic

Authored by andrew on Jul 26 2024, 8:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 7 2024, 8:21 PM
Unknown Object (File)
Dec 7 2024, 8:06 PM
Unknown Object (File)
Nov 27 2024, 10:02 PM
Unknown Object (File)
Nov 22 2024, 4:14 PM
Unknown Object (File)
Nov 20 2024, 3:24 PM
Unknown Object (File)
Nov 14 2024, 2:58 AM
Unknown Object (File)
Nov 12 2024, 7:53 PM
Unknown Object (File)
Nov 8 2024, 3:32 AM
Subscribers

Details

Summary

When enqueueing on an architecture with a weak memory model ensure
loading br->br_prod_head and br->br_cons_tail are ordered correctly.

If br_cons_tail is loaded first then other threads may perform a
dequeue and enqueue before br_prod_head is loaded. This will mean the
tail is one less than it should be and the code under the
prod_next == cons_tail check could incorrectly be skipped.

buf_ring_dequeue_mc has the same issue with br->br_prod_tail and
br->br_cons_head so needs the same fix.

Reported by: Ali Saidi <alisaidi@amazon.com>
Co-developed by: Ali Saidi <alisaidi@amazon.com>
Sponsored by: Arm Ltd

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable