Skip to content

rgw: fix CopyObj crash after admin override - #50648

Merged
cbodley merged 4 commits into
ceph:mainfrom
cbodley:wip-58035
Mar 31, 2023
Merged

cbodley merged 4 commits into
ceph:mainfrom
cbodley:wip-58035

Conversation

@cbodley

@cbodley cbodley commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

if RGWCopyObj::verify_permissions() returns an error, it may leave some zipper objects uninitialized. when the user has admin or system privileges, we'll ignore that error and call execute() anyway. this moves the initialization into RGWCopyObj::init_processing() instead

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

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

cbodley added 3 commits March 23, 2023 14:17
the CopyObject request is issued against the destination bucket/object,
so refer directly to s->bucket and s->object instead of creating
separate dst_bucket and dst_object handles

Signed-off-by: Casey Bodley <[email protected]>
the bucket_instance_id gets parsed from the "rgwx-bucket-instance"
header, and corresponds to the destination bucket. don't reuse it
for the src_bucket, whose name either comes from the s3 header
"x-amz-copy-source" or the swift header "x-copy-from"

Signed-off-by: Casey Bodley <[email protected]>
if `RGWCopyObj::verify_permissions()` returns an error, it may leave
some zipper objects uninitialized. when the user has admin or system
privileges, we'll ignore that error and call `execute()` anyway. this
moves the initialization into `RGWCopyObj::init_processing()` instead

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

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley requested review from dang and mkogan1 March 23, 2023 19:17
@cbodley
cbodley requested a review from a team as a code owner March 23, 2023 19:17
@cbodley

cbodley commented Mar 23, 2023

Copy link
Copy Markdown
Contributor Author

the first commit "dont duplicate sal handles in RGWCopyObj" was enough to resolve the crash on null dest_bucket, because s->bucket is already initialized

@cbodley
cbodley requested a review from mattbenjamin March 23, 2023 19:19
@cbodley

cbodley commented Mar 23, 2023

Copy link
Copy Markdown
Contributor Author

@mattbenjamin i requested your review for the rgw_file change; qa/workunits/rgw/test_librgw_file.sh still passes so i think it's correct

@mattbenjamin mattbenjamin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

Comment thread src/rgw/rgw_file.h
state->src_bucket_name = src_parent->bucket_name();
state->bucket_name = dst_parent->bucket_name();

std::string dest_obj_name = dst_parent->format_child_name(dst_name, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

Comment thread src/rgw/rgw_op.cc
@@ -5345,45 +5345,30 @@ int RGWCopyObj::verify_permission(optional_yield y)

RGWAccessControlPolicy dest_bucket_policy(s->cct);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

assuming this is correct, it's certainly easier to understand

Comment thread src/rgw/rgw_op.cc
ret = driver->get_bucket(dpp, nullptr,
rgw_bucket(s->src_tenant_name,
s->src_bucket_name,
s->bucket_instance_id),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what effect did this mix-up have?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it probably never mattered. we only set bucket_instance_id if the request included an "rgwx-bucket-instance" header, and we removed multisite's last use of that with the resharding changes. it had only been used for bucket listings, not copies

@mkogan1 mkogan1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

confirming solves the segfault in both known repro cases

  • copy existing obj over itself
  • copy non-existing obj

@cbodley

cbodley commented Mar 30, 2023

Copy link
Copy Markdown
Contributor Author

failed qa in https://pulpito.ceph.com/cbodley-2023-03-29_20:47:34-rgw-wip-cbodley-testing-distro-default-smithi/, including a crash during test_librgw_file.sh:

2023-03-29T22:29:56.217 INFO:tasks.workunit.client.0.smithi120.stdout:phase 1.1
2023-03-29T22:29:56.244 INFO:tasks.workunit.client.0.smithi120.stderr:src/tcmalloc.cc:332] Attempt to free invalid pointer 0x559275c03bd0
2023-03-29T22:29:56.284 DEBUG:teuthology.orchestra.run:got remote process result: 134
2023-03-29T22:29:56.285 INFO:tasks.workunit.client.0.smithi120.stderr:Aborted (core dumped)

this just makes it easier to build all of the tests needed by the
test_librgw_file.sh workunit

Signed-off-by: Casey Bodley <[email protected]>
@cbodley

cbodley commented Mar 30, 2023

Copy link
Copy Markdown
Contributor Author

update: seeing this tcmalloc crash all over the place in focal testing. vstart fails to bootstrap:

/home/cbodley/ceph/build/bin/ceph-mon --mkfs -c /home/cbodley/ceph/build/ceph.conf -i a --monmap=/tmp/ceph_monmap.3740 --keyring=/home/cbodley/ceph/build/keyring
src/tcmalloc.cc:332] Attempt to free invalid pointer 0x604000000010
../src/vstart.sh: line 28: 3816 Aborted (core dumped) PATH=$CEPH_BIN:$PATH "$@"
from gdb:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50                                                                   
#1  0x00007fffd0e1a859 in __GI_abort () at abort.c:79                                                                                       
#2  0x00007fffd21391d2 in ?? () from /lib/x86_64-linux-gnu/libtcmalloc.so.4                                                                 
#3  0x00007fffd213aca9 in ?? () from /lib/x86_64-linux-gnu/libtcmalloc.so.4                                       
#4  0x00007fffd214fe1d in MallocExtension::Initialize() () from /lib/x86_64-linux-gnu/libtcmalloc.so.4                                      
#5  0x00007fffd2139b1e in ?? () from /lib/x86_64-linux-gnu/libtcmalloc.so.4                                                                 
#6  0x00007ffff7fe0b9a in call_init (l=<optimized out>, argc=argc@entry=8, argv=argv@entry=0x7fffffffdff8, env=env@entry=0x7fffffffe040)    
    at dl-init.c:72                                                                                                                         
#7  0x00007ffff7fe0ca1 in call_init (env=0x7fffffffe040, argv=0x7fffffffdff8, argc=8, l=<optimized out>) at dl-init.c:30                    
#8  _dl_init (main_map=0x7ffff7ffe190, argc=8, argv=0x7fffffffdff8, env=0x7fffffffe040) at dl-init.c:119                                    
#9  0x00007ffff7fd013a in _dl_start_user () from /lib64/ld-linux-x86-64.so.2                                                                
#10 0x0000000000000008 in ?? ()

i see the same startup crash from ceph-osd and radosgw there

https://tracker.ceph.com/issues/58219 tracks a similar crash from the fs suite, but it went away after reverting a commit that changed ceph-dencoder linkage

@cbodley

cbodley commented Mar 30, 2023

Copy link
Copy Markdown
Contributor Author

@mattbenjamin

Copy link
Copy Markdown
Contributor

@mattbenjamin i'm seeing those same ubuntu20 crashes on main in https://pulpito.ceph.com/cbodley-2023-03-30_18:07:30-rgw:verify-main-distro-default-smithi/

that suggests this run was a pass, then?

Matt

@cbodley

cbodley commented Mar 30, 2023

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Mar 31, 2023

Copy link
Copy Markdown
Contributor Author

there were some other failures in the java and datacache tests in https://pulpito.ceph.com/cbodley-2023-03-29_20:47:34-rgw-wip-cbodley-testing-distro-default-smithi/

of those 17 failures, they all look unrelated. i did reruns for each distro:
ubuntu 20.04: https://pulpito.ceph.com/cbodley-2023-03-30_13:17:22-rgw:verify-wip-cbodley-testing-distro-default-smithi/
centos 8: https://pulpito.ceph.com/cbodley-2023-03-30_20:32:49-rgw:verify-wip-cbodley-testing-distro-default-smithi/
ubuntu 22.04: https://pulpito.ceph.com/cbodley-2023-03-30_21:31:09-rgw:verify-wip-cbodley-testing-distro-default-smithi/

only the ubuntu 20.04 failures prevented other tests from running. the centos tests were green, and the ubuntu 22.04 runs contained POOL_APP_NOT_ENABLED cluster warnings that will probably be whitelisted in #47560

i've opened https://tracker.ceph.com/issues/59269 about the tcmalloc crash in librgw_file tests and mailed the dev list. @mkogan1 and i are discussing the datacache failure in #49328

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.

4 participants