Project

General

Profile

Actions

Bug #41225

closed

rgw: GETing S3 website root with two slashes // crashes rgw

Added by Dan van der Ster over 4 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
nautilus, octopus
Regression:
No
Severity:
1 - critical
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

RGW crashes if you curl a website root with 2 slashes.

First, we create a new bucket and website configuration:

~ $ s3cmd mb -P s3://dvanders-test4
Bucket 's3://dvanders-test4/' created
~ $ s3cmd ws-create s3://dvanders-test4
Bucket 's3://dvanders-test4/': website configuration created.

Now, curl the website root returns 404 (as expected)

~ $ curl http://dvanders-test4.s3-website.cern.ch/
<html>
 <head><title>404 Not Found</title></head>
 <body>
  <h1>404 Not Found</h1>
  <ul>
   <li>Code: NoSuchKey</li>
   <li>BucketName: dvanders-test4</li>
   <li>RequestId: tx00000000000000040d7fa-005d52a626-53a780a-default</li>
   <li>HostId: 53a780a-default-default</li>

But curl the root with an extra // crashes the rgw:

~ $ curl http://dvanders-test4.s3-website.cern.ch//
Bad Gatewayā¸ˇ

Here is the rgw log:

/builddir/build/BUILD/ceph-12.2.12/src/rgw/rgw_rados.h: In function 'void RGWObjectCtxImpl<T, S>::set_atomic(T&) [with T = rgw_obj; S = RGWObjState]' thread 7f7a1066e700 time 2019-08-13 13:51:12.867584
/builddir/build/BUILD/ceph-12.2.12/src/rgw/rgw_rados.h: 2150: FAILED assert(!obj.empty())
 ceph version 12.2.12 (1436006594665279fe734b4c15d7e08c13ebd777) luminous (stable)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x110) [0x7f7aba0f8ed0]
 2: (RGWHandler_REST_S3Website::web_dir() const+0x449) [0x55db02c2fdc9]
 3: (RGWHandler_REST_S3Website::retarget(RGWOp*, RGWOp**)+0x103) [0x55db02c2ff23]
 4: (rgw_process_authenticated(RGWHandler_REST*, RGWOp*&, RGWRequest*, req_state*, bool)+0x1d2) [0x55db02b3e6d2]
 5: (process_request(RGWRados*, RGWREST*, RGWRequest*, std::string const&, rgw::auth::StrategyRegistry const&, RGWRestfulIO*, OpsLogSocket*, int*)+0xb98) [0x55db02b3f428]
 6: (()+0x24de6e) [0x55db029d5e6e]
 7: (()+0x24e9db) [0x55db029d69db]
 8: (make_fcontext()+0x2f) [0x55db02da81ef]


Related issues 2 (0 open2 closed)

Copied to rgw - Backport #46966: octopus: rgw: GETing S3 website root with two slashes // crashes rgwResolvedNathan CutlerActions
Copied to rgw - Backport #46967: nautilus: rgw: GETing S3 website root with two slashes // crashes rgwResolvedActions
Actions

Also available in: Atom PDF