Project

General

Profile

Bug #14191

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

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:
hammer, infernalis
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/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 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
 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

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


Related issues

Copied to rgw - Backport #15256: infernalis: rgw: radosgw server abort when user passed bad parameters to set quota Rejected
Copied to rgw - Backport #15257: hammer: rgw: radosgw server abort when user passed bad parameters to set quota Resolved

Associated revisions

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

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

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: #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 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
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&lt;bool&gt;(char const*, bool&, JSONObj*, bool)+0x288) [0x7f0e13d74c2c]
11: (RGWQuotaInfo::decode_json(JSONObj*)+0x6c) [0x7f0e13d71128]
12: (void decode_json_obj&lt;RGWQuotaInfo&gt;(RGWQuotaInfo&, JSONObj*)+0x23) [0x7f0e13d21f16]
13: (int rgw_rest_get_json_input&lt;RGWQuotaInfo&gt;(CephContext*, req_state*, RGWQuotaInfo&, int, bool*)+0x11e) [0x7f0e13d21e48]
14: (RGWOp_Quota_Set::execute()+0x8c9) [0x7f0e13d1ed6d]
15: (()+0x7532d2) [0x7f0e13d4f2d2

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

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

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

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: #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 (c485d29a53f6a2c1a3b561c54632dbac1c4e9473)
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&lt;bool&gt;(char const*, bool&, JSONObj*, bool)+0x288) [0x7f0e13d74c2c]
11: (RGWQuotaInfo::decode_json(JSONObj*)+0x6c) [0x7f0e13d71128]
12: (void decode_json_obj&lt;RGWQuotaInfo&gt;(RGWQuotaInfo&, JSONObj*)+0x23) [0x7f0e13d21f16]
13: (int rgw_rest_get_json_input&lt;RGWQuotaInfo&gt;(CephContext*, req_state*, RGWQuotaInfo&, int, bool*)+0x11e) [0x7f0e13d21e48]
14: (RGWOp_Quota_Set::execute()+0x8c9) [0x7f0e13d1ed6d]
15: (()+0x7532d2) [0x7f0e13d4f2d2

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

Conflicts:
src/rgw/rgw_rest.h
hammer version lacks rgw_rest_get_json_input_keep_data()
template

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 Pending Backport

#3 Updated by Yehuda Sadeh over 6 years ago

  • Backport set to hammer, infernalis

#4 Updated by Nathan Cutler over 6 years ago

  • Copied to Backport #15256: infernalis: rgw: radosgw server abort when user passed bad parameters to set quota added

#5 Updated by Nathan Cutler over 6 years ago

  • Copied to Backport #15257: hammer: rgw: radosgw server abort when user passed bad parameters to set quota added

#6 Updated by Loïc Dachary over 6 years ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF