Project

General

Profile

Bug #14190

rgw: radosgw server abort when user passed bad parameters to set metadata

Added by Dunrong Huang almost 7 years ago. Updated over 6 years ago.

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

0%

Source:
other
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

$ curl -X PUT http://ceph1:9090/admin/metadata?user&format=json -d 'data = { "mtime": "null"}'

terminate called after throwing an instance of 'JSONDecoder::err'
*** Caught signal (Aborted) **
 in thread 7ff982f55700
 ceph version 10.0.1-787-gc485d29 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
 1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x7ffa814db8c5]
 2: (()+0x8fbfb7) [0x7ffa814dafb7]
 3: (()+0xf100) [0x7ffa758a6100]
 4: (gsignal()+0x37) [0x7ffa748e05f7]
 5: (abort()+0x148) [0x7ffa748e1ce8]
 6: (__gnu_cxx::__verbose_terminate_handler()+0x165) [0x7ffa751e49b5]
 7: (()+0x5e926) [0x7ffa751e2926]
 8: (()+0x5e953) [0x7ffa751e2953]
 9: (()+0x5eb73) [0x7ffa751e2b73]
 10: (bool JSONDecoder::decode_json<long>(char const*, long&, JSONObj*, bool)+0x28c) [0x7ffa8135920a]
 11: (RGWMetadataManager::put(std::string&, ceph::buffer::list&, RGWMetadataHandler::sync_type_t, obj_version*)+0x173) [0x7ffa81468029]
 12: (RGWOp_Metadata_Put::execute()+0x172) [0x7ffa81308dcc]
 13: (()+0x7532d2) [0x7ffa813322d2]
 14: (RGWFCGXProcess::handle_request(RGWRequest*)+0x90) [0x7ffa813328a4]

the radosgw server should return error message with InvalidArgument rather than abort/exit.

Associated revisions

Revision 83503239 (diff)
Added by Dunrong Huang almost 7 years ago

rgw: do not abort when user passed bad parameters to set metadata

Fixes: #14190

when user passes bad parameter(e.g. pass "null" to bool parameter), the ceph_json.cc::decode_json_obj()
will raise a exception with type of JSONDecoder::err(). If we do not catch this exception, the radosgw
server will abort.

$ curl -X PUT http://ceph1:9090/admin/metadata?user&format=json -d 'data = { "mtime": "null"}'

terminate called after throwing an instance of 'JSONDecoder::err'
  • Caught signal (Aborted) *
    in thread 7ff982f55700
    ceph version 10.0.1-787-gc485d29 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
    1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x7ffa814db8c5]
    2: (()+0x8fbfb7) [0x7ffa814dafb7]
    3: (()+0xf100) [0x7ffa758a6100]
    4: (gsignal()+0x37) [0x7ffa748e05f7]
    5: (abort()+0x148) [0x7ffa748e1ce8]
    6: (_gnu_cxx::_verbose_terminate_handler()+0x165) [0x7ffa751e49b5]
    7: (()+0x5e926) [0x7ffa751e2926]
    8: (()+0x5e953) [0x7ffa751e2953]
    9: (()+0x5eb73) [0x7ffa751e2b73]
    10: (bool JSONDecoder::decode_json<long>(char const
    , long&, JSONObj*, bool)+0x28c) [0x7ffa8135920a]
    11: (RGWMetadataManager::put(std::string&, ceph::buffer::list&, RGWMetadataHandler::sync_type_t, obj_version*)+0x173) [0x7ffa81468029]
    12: (RGWOp_Metadata_Put::execute()+0x172) [0x7ffa81308dcc]
    13: (()+0x7532d2) [0x7ffa813322d2]
    14: (RGWFCGXProcess::handle_request(RGWRequest*)+0x90) [0x7ffa813328a4]

Reported-by: Coffee Chou <>
Signed-off-by: Dunrong Huang <>

Revision 9786394b (diff)
Added by Dunrong Huang over 6 years ago

rgw: do not abort when user passed bad parameters to set metadata

Fixes: #14190

when user passes bad parameter(e.g. pass "null" to bool parameter), the ceph_json.cc::decode_json_obj()
will raise a exception with type of JSONDecoder::err(). If we do not catch this exception, the radosgw
server will abort.

$ curl -X PUT http://ceph1:9090/admin/metadata?user&format=json -d 'data = { "mtime": "null"}'

terminate called after throwing an instance of 'JSONDecoder::err'
  • Caught signal (Aborted) *
    in thread 7ff982f55700
    ceph version 10.0.1-787-gc485d29 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
    1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x7ffa814db8c5]
    2: (()+0x8fbfb7) [0x7ffa814dafb7]
    3: (()+0xf100) [0x7ffa758a6100]
    4: (gsignal()+0x37) [0x7ffa748e05f7]
    5: (abort()+0x148) [0x7ffa748e1ce8]
    6: (_gnu_cxx::_verbose_terminate_handler()+0x165) [0x7ffa751e49b5]
    7: (()+0x5e926) [0x7ffa751e2926]
    8: (()+0x5e953) [0x7ffa751e2953]
    9: (()+0x5eb73) [0x7ffa751e2b73]
    10: (bool JSONDecoder::decode_json<long>(char const
    , long&, JSONObj*, bool)+0x28c) [0x7ffa8135920a]
    11: (RGWMetadataManager::put(std::string&, ceph::buffer::list&, RGWMetadataHandler::sync_type_t, obj_version*)+0x173) [0x7ffa81468029]
    12: (RGWOp_Metadata_Put::execute()+0x172) [0x7ffa81308dcc]
    13: (()+0x7532d2) [0x7ffa813322d2]
    14: (RGWFCGXProcess::handle_request(RGWRequest*)+0x90) [0x7ffa813328a4]

Reported-by: Coffee Chou <>
Signed-off-by: Dunrong Huang <>
(cherry picked from commit 83503239c81573232429a5fe98381f1a8f1357e9)

Conflicts:
src/rgw/rgw_user.cc
hammer version uses RGWUserInfo instead of RGWUserCompleteInfo

History

#1 Updated by Dunrong Huang almost 7 years ago

patches have been pushed:
https://github.com/ceph/ceph/pull/7063

#2 Updated by Yehuda Sadeh over 6 years ago

  • Status changed from New to Resolved

Also available in: Atom PDF