Skip to content

rgw: fix segfault in UserAsyncRefreshHandler::init_fetch#44859

Merged
cbodley merged 1 commit intoceph:masterfrom
cfsnyder:wip-54112-rgw-segfault-init-fetch
Mar 8, 2022
Merged

rgw: fix segfault in UserAsyncRefreshHandler::init_fetch#44859
cbodley merged 1 commit intoceph:masterfrom
cfsnyder:wip-54112-rgw-segfault-init-fetch

Conversation

@cfsnyder
Copy link
Contributor

@cfsnyder cfsnyder commented Feb 2, 2022

Fixes a segfault that was occuring in error handling code of UserAsyncRefreshHandler::init_fetch.
When ruser->read_stats_async returned an error code, the instance of UserAsyncRefreshHandler had
already been deallocated in RGWSI_User_RADOS::read_stats_async and a segmentation fault occurs
when attempting to print a member variable in error logs. This commit removes the extra ref count
drop since the ref is properly dropped upstream in RGWQuotaCache::async_refresh error handling
logic.

Fixes: https://tracker.ceph.com/issues/54112
Signed-off-by: Cory Snyder csnyder@iland.com

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)

Fixes a segfault that was occuring in error handling code of UserAsyncRefreshHandler::init_fetch.
When ruser->read_stats_async returned an error code, the instance of UserAsyncRefreshHandler had
already been deallocated in RGWSI_User_RADOS::read_stats_async and a segmentation fault occurs
when attempting to print a member variable in error logs. This commit removes the extra ref count
drop since the ref is properly dropped upstream in RGWQuotaCache::async_refresh error handling
logic.

Fixes: https://tracker.ceph.com/issues/54112
Signed-off-by: Cory Snyder <csnyder@iland.com>
@github-actions github-actions bot added the rgw label Feb 2, 2022
@cfsnyder cfsnyder requested a review from yehudasa February 18, 2022 16:36
@cbodley cbodley self-requested a review February 23, 2022 16:12
Copy link
Contributor

@cbodley cbodley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the detailed commit message, the ref is indeed dropped twice in this error path

@cbodley
Copy link
Contributor

cbodley commented Mar 8, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants