Repository navigation
rgw: fix use-after-free on cancellation in shard_io::async_reads() - #70918
Conversation
e16ca4c to
ba3b42f
Compare
|
looks good! there is a similar pattern in |
WaitCancellation handles cancellation signals from outside of the coroutine, so there isn't a natural entry in 'outstanding' to preserve until the end. rather than using |
when ReadHandler encounters an error and cancels other outstanding requests, its calls to emit() likely execute those cancellation handlers inline. these can cause async_reads() to wake up and co_return prematurely while the initial ReadHandler is still looping over the 'outstanding' list on its stack prevent this early return by leaving this initial shard in the 'outstanding' list during the cancellation loop adjust WaitCancellation to use a local variable for the loop condition. this way if the final cancellation wakes the calling coroutine and causes it to return, we don't try to access its stack memory again with 'i != outstanding.end()' Fixes: https://tracker.ceph.com/issues/79095 Signed-off-by: Casey Bodley <[email protected]> Co-authored-by: Shilpa Jagannath <[email protected]>
|
i added some printfs to verify that these test cases are in fact exercising the race between ReadHandlers and co_return: |
|
pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/79449 |
when ReadHandler encounters an error and cancels other outstanding requests, its calls to emit() likely execute those cancellation handlers inline. these can cause async_reads() to wake up and co_return prematurely while the initial ReadHandler is still looping over the 'outstanding' list on its stack
prevent this early return by leaving this initial shard in the 'outstanding' list during the cancellation loop
Fixes: https://tracker.ceph.com/issues/79095
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.