Skip to content

Fix denial of service with large numbers in cpuset-cpus and cpuset-mems#37967

Merged
yongtang merged 1 commit intomoby:masterfrom
thaJeztah:upstream_dos_fix
Oct 8, 2018
Merged

Fix denial of service with large numbers in cpuset-cpus and cpuset-mems#37967
yongtang merged 1 commit intomoby:masterfrom
thaJeztah:upstream_dos_fix

Conversation

@thaJeztah
Copy link
Member

Using a value such as --cpuset-mems=1-9223372036854775807 would cause
dockerd to run out of memory allocating a map of the values in the
validation code. Set limits to the normal limit of the number of CPUs,
and improve the error handling.

Reported by Huawei PSIRT.

- Description for the changelog

* Fix denial of service with large numbers in `--cpuset-cpus` and `--cpuset-mems`

@thaJeztah
Copy link
Member Author

ping @justincormack @AkihiroSuda @vdemeester PTAL 🤗

Copy link
Member

Choose a reason for hiding this comment

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

Should we keep the signature (for not breaking downstream-dependencies) and add a new method ParsUintListMaximum or something ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yes; I could add a new one.

@codecov
Copy link

codecov bot commented Oct 4, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@c77cfbf). Click here to learn what that means.
The diff coverage is 62.5%.

@@            Coverage Diff            @@
##             master   #37967   +/-   ##
=========================================
  Coverage          ?    36.1%           
=========================================
  Files             ?      610           
  Lines             ?    45155           
  Branches          ?        0           
=========================================
  Hits              ?    16302           
  Misses            ?    26612           
  Partials          ?     2241

@thaJeztah
Copy link
Member Author

@vdemeester pushed an extra commit; if it looks good, I'll squash, and update my backports 😅

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

Using a value such as `--cpuset-mems=1-9223372036854775807` would cause
`dockerd` to run out of memory allocating a map of the values in the
validation code. Set limits to the normal limit of the number of CPUs,
and improve the error handling.

Reported by Huawei PSIRT.

Signed-off-by: Justin Cormack <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

Squashed; this should be ready to go

ping @justincormack PTAL

Copy link
Member

@yongtang yongtang left a comment

Choose a reason for hiding this comment

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

LGTM

@yongtang yongtang merged commit 2cc338c into moby:master Oct 8, 2018
@thaJeztah thaJeztah deleted the upstream_dos_fix branch October 9, 2018 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants