Project

General

Profile

Bug #19249

rgw: unsafe access in RGWListBucket_ObjStore_SWIFT::send_response()

Added by Yehuda Sadeh about 2 months ago. Updated 14 days ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
03/09/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
kraken, jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Needs Doc:
No

Description

iter->key is accessed even if iter == objs.end():

  while (iter != objs.end() || pref_iter != common_prefixes.end()) {
    bool do_pref = false;
    bool do_objs = false;
    rgw_obj_key& key = iter->key;
    if (pref_iter == common_prefixes.end())
      do_objs = true;
    else if (iter == objs.end())
      do_pref = true;
    else if (key.name.compare(pref_iter->first) == 0) {
      do_objs = true;
      ++pref_iter;
    } else if (key.name.compare(pref_iter->first) <= 0)
      do_objs = true;
    else
      do_pref = true;

This caused an issue in another branch where we don't take a ref to iter->key, but copy it. We should avoid accessing it anyway.


Related issues

Copied to Backport #19574: kraken: rgw: unsafe access in RGWListBucket_ObjStore_SWIFT::send_response() Need Review
Copied to Backport #19575: jewel: rgw: unsafe access in RGWListBucket_ObjStore_SWIFT::send_response() In Progress

History

#2 Updated by Nathan Cutler 14 days ago

  • Backport set to kraken

#3 Updated by Nathan Cutler 14 days ago

  • Backport changed from kraken to kraken, jewel

#4 Updated by Nathan Cutler 14 days ago

  • Copied to Backport #19574: kraken: rgw: unsafe access in RGWListBucket_ObjStore_SWIFT::send_response() added

#5 Updated by Nathan Cutler 14 days ago

  • Copied to Backport #19575: jewel: rgw: unsafe access in RGWListBucket_ObjStore_SWIFT::send_response() added

Also available in: Atom PDF