Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

[18.09 backport] client: use io.LimitedReader for reading HTTP error #114

Merged

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Nov 12, 2018

client.checkResponseErr() was hanging and consuming infinite memory
when the serverResp.Body io.Reader returns infinite stream.

This commit prohibits reading more than 1MiB.

this is a backport of moby#38006

client.checkResponseErr() was hanging and consuming infinite memory
when the serverResp.Body io.Reader returns infinite stream.

This commit prohibits reading more than 1MiB.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
(cherry picked from commit 1db4be0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the 18.09.1 milestone Nov 12, 2018
Copy link

@andrewhsu andrewhsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewhsu andrewhsu merged commit 52a6fc0 into docker-archive:18.09 Nov 27, 2018
@thaJeztah thaJeztah deleted the 18.09_backport_limit_client_readall branch November 27, 2018 18:05
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Mar 27, 2019
relevant changes;

- moby/moby#38006 / docker-archive/engine#114 client: use io.LimitedReader for reading HTTP error
- moby/moby#38634 / docker-archive/engine#167 pkg/archive:CopyTo(): fix for long dest filename
  - fixes docker/for-linux#484 for 18.09
- moby/moby#38944 / docker-archive/engine#183 gitutils: add validation for ref
- moby/moby#37780 / docker-archive/engine#55 pkg/progress: work around closing closed channel panic
  - addresses moby/moby#/37735 pkg/progress: panic due to race on shutdown

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Mar 27, 2019
relevant changes;

- moby/moby#38006 / docker-archive/engine#114 client: use io.LimitedReader for reading HTTP error
- moby/moby#38634 / docker-archive/engine#167 pkg/archive:CopyTo(): fix for long dest filename
  - fixes docker/for-linux#484 for 18.09
- moby/moby#38944 / docker-archive/engine#183 gitutils: add validation for ref
- moby/moby#37780 / docker-archive/engine#55 pkg/progress: work around closing closed channel panic
  - addresses moby/moby#/37735 pkg/progress: panic due to race on shutdown

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 010c234a0d5a03d450ebec60be37dd9f279feeca
Component: cli
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants