Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: catch manifest decode errors in GetObj #50172

Merged
merged 4 commits into from Mar 2, 2023
Merged

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Feb 19, 2023

Fixes: https://tracker.ceph.com/issues/58794

this catches exceptions on decode to avoid crashing, but also fixes several cases in RGWRados where we accidentally create empty attributes with the [] operator

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

bufferlist manifest_bl = s->attrset[RGW_ATTR_MANIFEST];
if (manifest_bl.length()) {
if (iter = s->attrset.find(RGW_ATTR_MANIFEST); iter != s->attrset.end()) {
bufferlist manifest_bl = iter->second;
Copy link
Contributor

Choose a reason for hiding this comment

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

why not const bufferlist& here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the call to generate_fake_tag() takes this as a mutable reference

@cbodley
Copy link
Contributor Author

cbodley commented Feb 20, 2023

i see there are similar decodes in RGWPutObj and RGWCopyObj that also need to be addressed

if we read an object that doesn't have a manifest attribute,
RGWRados::get_obj_state_impl() adds an empty one and causes decode to
throw an end_of_buffer exception

Fixes: https://tracker.ceph.com/issues/58794

Signed-off-by: Casey Bodley <cbodley@redhat.com>
better to tell the s3 client why their request failed than to log it as
an ERROR; this is normal/expected when cloud tiering is enabled

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley
Copy link
Contributor Author

cbodley commented Mar 2, 2023

@cbodley
Copy link
Contributor Author

cbodley commented Mar 2, 2023

jenkins test make check

@cbodley cbodley merged commit 8c5ca36 into ceph:main Mar 2, 2023
@cbodley cbodley deleted the wip-58794 branch March 2, 2023 14:07
This was referenced May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants