Repository navigation
rgw/amqp: check the iterator before dereferencing it - #71666
Conversation
|
@yuvalif hi Yuval, do you mind taking a look? |
|
@tchaikov problem looks real, but this is strange. this should have crashed every time we drain the callback queue. |
|
could you please open a tracker as mark backports as: umbrella, tentacle (and squid?) |
@yuvalif . this is indeed an interesting topic. but IIUC, it can't crash, because the read stays inside the vector's own allocation. CallbackList is a |
A broker can confirm several messages at once by setting the "multiple"
flag, which acks every delivery tag up to and including the one in the
frame. The loop that invokes those callbacks tests it->tag before
testing whether it still points at an element:
while (it->tag <= tag && it != conn->callbacks.end()) {
erase() returns end() once the last callback is gone, so the next
iteration reads past the end of the list. Swap the two conditions.
Reaching it takes an ack that covers every callback still pending on
the connection. Any callback left over keeps the loop inside the list,
which is why this has not caused trouble so far.
Fixes: https://tracker.ceph.com/issues/80464
Signed-off-by: Kefu Chai <[email protected]>
3c0bcb8 to
88d2208
Compare
sure. created https://tracker.ceph.com/issues/80464 |
rgw/amqp: check the iterator before dereferencing it Reviewed-by: Yuval Lifshitz <[email protected]>
A broker can confirm several messages at once by setting the "multiple" flag, which acks every delivery tag up to and including the one in the frame. The loop that invokes those callbacks tests it->tag before testing whether it still points at an element:
while (it->tag <= tag && it != conn->callbacks.end()) {erase() returns end() once the last callback is gone, so the next iteration reads past the end of the list. Swap the two conditions.
Reaching it takes an ack that covers every callback still pending on the connection. Any callback left over keeps the loop inside the list, which is why this has not caused trouble so far.
Fixes: https://tracker.ceph.com/issues/80464
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.