scheduler hang (DOS) possible with DifferentHostFilter/SameHostFilter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Dan Prince | ||
Essex |
Fix Released
|
High
|
Dan Prince | ||
nova (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When using Nova scheduler with either the DifferentHostFilter and/or SameHostFilter we expose a way to make repeated DB calls via compute_api.get(). A user could submit requests to create servers with scheduler_hints such that thousands of DB calls to lookup an instance ID are made... which can cause the Nova scheduler to hang until the all the lookups are finished.
To reproduce:
1) Create a valid instance.
2) Obtain the 'ID' of the instance. You can do this by looking at the instance_name (an extended server attribute)
3) Create specially formated server create request which repeates the valid instance ID in the os:scheduler_hints part of the request. See the following example request:
{
"server" : {
"name" : "sched_tester",
"imageRef" : "7d3b6df9-
"flavorRef" : "1"
},
"os:scheduler_
"same_host": ["1234", "1234", "1234", "1234", "1234", "1234", "1234", "1234", "1234"...]
}
}
If you script it you can repeat the ID 10,000 times or so before you hit the request size limit for nova... plenty enough to cause Nova scheduler hangs for 5-10 minutes per server request (actual times would depend on DB performance, size, etc.)
Making 5-10 of these requests could take out all the Nova schedulers for a given cloud thus causing a server outage.
-----
As a temporary workaround users can simply disable the DifferentHostFilter and/or SameHostFilter options in nova.conf. (these are not on by default so users would have had to enable them to begin with)
-----
A good solution to this might be to avoid repeated calls to compute_api.get and replace them with a single call to get all the instance host IDs for a particular user/tenant. This would however limit the selection capabilities to instances within the current user/tenants account. I think this is acceptable. We could also put a flat limit on the number of allowed instance_id/uuids used for the scheduler_hint requests.
-----
It looks like this affects both Folsom and Essex.
Related branches
- Chuck Short: Pending requested
-
Diff: 56 lines (+14/-4)3 files modifieddebian/changelog (+8/-0)
debian/control (+6/-3)
debian/nova-console.install (+0/-1)
CVE References
Changed in nova: | |
assignee: | nobody → Dan Prince (dan-prince) |
status: | New → In Progress |
Changed in nova: | |
milestone: | none → folsom-3 |
status: | Fix Committed → Fix Released |
Changed in nova (Ubuntu): | |
status: | New → Fix Released |
Changed in nova (Ubuntu Precise): | |
status: | New → Confirmed |
Changed in nova: | |
milestone: | folsom-3 → 2012.2 |
@Dan: good find -- if you work on a patch, please post it here (private) rather than on Gerrit (public).