formpost middleware crashes for uploads larger 2 GiB

Bug #1326429 reported by Christian Schwede
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Christian Schwede

Bug Description

If a user tries to upload a file that is larger than 2GiB the upload fails due to an error OverflowError.

Actually this happens in python/socket.py, but it can be fixed either in swift/common/utils.py line 2406 or swift/common/middleware/formpost.py line 245. In both cases it's possible to use a long(-1) as the default instead of None (which would be converted to an int(-1) later on).

Note that this happens on 64bit systems.

Revision history for this message
Christian Schwede (cschwede) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/97828

Changed in swift:
status: New → In Progress
Revision history for this message
Peter Portante (peter-a-portante) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/97828
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=7056ec6a16fd8707564ec4b0a05cab461ee2a80d
Submitter: Jenkins
Branch: master

commit 7056ec6a16fd8707564ec4b0a05cab461ee2a80d
Author: Christian Schwede <email address hidden>
Date: Wed Jun 4 15:27:48 2014 +0000

    Fix file uploads > 2 GiB in formpost middleware

    Formpost middleware fails to upload files larger then 2 GiB due to
    an Overflow error. The reason is that the readline() will use a
    readline(int(content_length)) later on and fail if it is larger than
    2GiB. Since it is not required to read the whole content into memory
    to detect the boundary only read the amount of required bytes.

    The underlying error is located in Python 2.7 and is related to
    cStringIO: http://bugs.python.org/issue7358

    Closes-Bug: #1326429
    Change-Id: I196edda647921c2691d278cebd1cca80ebd360f2

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
status: Fix Committed → Fix Released
milestone: none → 2.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.