Bug #78937
closedpython/rbd: Iterator cleanups relies on zero-initialized array elements after listing errors
0%
Description
Several pybind/rbd iterator classes retain the requested element count when a C API listing call fails. If an exception is raised, the corresponding cleanup C API is invoked with the stale count and may iterate over array elements that were never successfully initialized.
This is currently safe because the C APIs zero-initialize the allocated arrays with memset, causing the cleanup routines to encounter only NULL pointers for uninitialized entries. However, this behavior depends on an implementation detail of the C APIs and is not something the iterator cleanup logic should rely on.
The iterator should reset its element count when a listing operation fails so that the cleanup C API processes only successfully initialized elements.
RR Updated by Ramana Raja 4 months ago
- Pull request ID set to 70755
RR Updated by Ramana Raja 4 months ago
- Status changed from In Progress to Fix Under Review
ID Updated by Ilya Dryomov 3 months ago
- Backport set to squid,tentacle,umbrella
ID Updated by Ilya Dryomov 3 months ago
- Related to Bug #78034: pybind/rbd: handle non-existent groups properly in list_snaps() added
UB Updated by Upkeep Bot 3 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to bc971c07c87a2a8132f99fb816133b5e8fac82c5
- Fixed In set to v21.3.0-2532-gbc971c07c8
- Upkeep Timestamp set to 2026-08-23T17:45:35+00:00
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #79749: squid: python/rbd: Iterator cleanups relies on zero-initialized array elements after listing errors added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #79750: umbrella: python/rbd: Iterator cleanups relies on zero-initialized array elements after listing errors added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #79751: tentacle: python/rbd: Iterator cleanups relies on zero-initialized array elements after listing errors added
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-08-23T17:45:35+00:00 to 2026-08-27T18:46:40+00:00
UB Updated by Upkeep Bot about 1 month ago
- Status changed from Backporting to Resolved
- Upkeep Timestamp changed from 2026-08-27T18:46:40+00:00 to 2026-10-29T01:08:00+00:00