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

hammer: rgw: radosgw server abort when user passed bad parameters to set quota #8313

Merged
merged 2 commits into from Jul 29, 2016

Conversation

smithfarm
Copy link
Contributor

Fixes: ceph#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 (c485d29)
 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 <coffee.zyr@gmail.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
(cherry picked from commit 8350323)

Conflicts:
	src/rgw/rgw_user.cc
            hammer version uses RGWUserInfo instead of RGWUserCompleteInfo
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.

Fixes: ceph#14191

$ curl -X PUT http://ceph1:9090/admin/user?quota&uid=test5&quota-type=user -d '{"enabled": "null"}'

 0> 2015-12-28 11:25:20.864091 7f0d46fb5700 -1 *** Caught signal (Aborted) **
 in thread 7f0d46fb5700

 ceph version 10.0.1-787-gc485d29 (c485d29)
 1: (ceph::BackTrace::BackTrace(int)+0x2d) [0x7f0e13ef88c5]
 2: (()+0x8fbfb7) [0x7f0e13ef7fb7]
 3: (()+0xf100) [0x7f0e082c3100]
 4: (gsignal()+0x37) [0x7f0e072fd5f7]
 5: (abort()+0x148) [0x7f0e072fece8]
 6: (__gnu_cxx::__verbose_terminate_handler()+0x165) [0x7f0e07c019b5]
 7: (()+0x5e926) [0x7f0e07bff926]
 8: (()+0x5e953) [0x7f0e07bff953]
 9: (()+0x5eb73) [0x7f0e07bffb73]
 10: (bool JSONDecoder::decode_json<bool>(char const*, bool&, JSONObj*, bool)+0x288) [0x7f0e13d74c2c]
 11: (RGWQuotaInfo::decode_json(JSONObj*)+0x6c) [0x7f0e13d71128]
 12: (void decode_json_obj<RGWQuotaInfo>(RGWQuotaInfo&, JSONObj*)+0x23) [0x7f0e13d21f16]
 13: (int rgw_rest_get_json_input<RGWQuotaInfo>(CephContext*, req_state*, RGWQuotaInfo&, int, bool*)+0x11e) [0x7f0e13d21e48]
 14: (RGWOp_Quota_Set::execute()+0x8c9) [0x7f0e13d1ed6d]
 15: (()+0x7532d2) [0x7f0e13d4f2d2

Reported-by: Coffee Chou <coffee.zyr@gmail.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
(cherry picked from commit 59f9058)

Conflicts:
	src/rgw/rgw_rest.h
            hammer version lacks rgw_rest_get_json_input_keep_data()
            template
@smithfarm smithfarm self-assigned this Mar 25, 2016
@smithfarm smithfarm added this to the hammer milestone Mar 25, 2016
ghost pushed a commit that referenced this pull request Apr 5, 2016
… passed bad parameters to set quota

Reviewed-by: Loic Dachary <ldachary@redhat.com>
smithfarm added a commit that referenced this pull request Jun 1, 2016
… passed bad parameters to set quota

Reviewed-by: Nathan Cutler <ncutler@suse.com>
@oritwas oritwas self-assigned this Jun 14, 2016
@mattbenjamin
Copy link
Contributor

@smithfarm any update on this? (pending_backport in tracker 14191)

@smithfarm
Copy link
Contributor Author

@mattbenjamin It is included in the current integration testing round. Status is always available at http://tracker.ceph.com/issues/15895

@smithfarm
Copy link
Contributor Author

Any idea what could be causing this crash? http://tracker.ceph.com/issues/16323

smithfarm added a commit that referenced this pull request Jun 27, 2016
… passed bad parameters to set quota

Reviewed-by: Nathan Cutler <ncutler@suse.com>
smithfarm added a commit that referenced this pull request Jul 18, 2016
… passed bad parameters to set quota

Reviewed-by: Nathan Cutler <ncutler@suse.com>
smithfarm added a commit that referenced this pull request Jul 24, 2016
… passed bad parameters to set quota

Reviewed-by: Nathan Cutler <ncutler@suse.com>
@smithfarm
Copy link
Contributor Author

@oritwas This PR passed an rgw suite with some valgrind-related failures that appear harmless - see http://tracker.ceph.com/issues/15895#note-19

Do you think this PR is ready to merge?

@oritwas
Copy link
Member

oritwas commented Jul 28, 2016

lgtm

@smithfarm smithfarm merged commit f3cbf5f into ceph:hammer Jul 29, 2016
@smithfarm smithfarm deleted the wip-15257-hammer branch July 29, 2016 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants