Multiple APIs not thread-safe

Bug #1954351 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
liberasurecode
New
Undecided
Unassigned

Bug Description

According to the docstring [0], liberasurecode_backend_instance_get_by_desc() expects callers to already hold active_instances_rwlock, but only liberasurecode_backend_instance_register() and liberasurecode_backend_instance_unregister() do. As a result, the following callers may try to read the data structure while it's still being updated in another thread:

- liberasurecode_instance_destroy(), before it calls liberasurecode_backend_instance_unregister()
- liberasurecode_encode_cleanup()
- liberasurecode_encode()
- liberasurecode_decode_cleanup()
- liberasurecode_decode()
- liberasurecode_reconstruct_fragment()
- liberasurecode_fragments_needed()
- is_invalid_fragment_metadata()
- is_invalid_fragment()
- liberasurecode_get_aligned_data_size()
- liberasurecode_get_fragment_size()
- liberasurecode_verify_stripe_metadata() (indirectly, via is_invalid_fragment_metadata() and is_invalid_fragment())

[0] https://opendev.org/openstack/liberasurecode/src/tag/1.6.2/src/erasurecode.c#L83-L97

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.