Granularity of Credit and RTDS Scheduler
Il 08 gen 2017 08:31, Meng Xu <[email protected]> ha scritto:
[cc. Dario and George]
Quoted 1 line · On Fri, Jan 6, 2017 at 1:34 PM, wy11 <[email protected]> wrote:
Dear Xen developers,
Hi,
Quoted 5 lines
Recently I read a paper about possible theft of service attacks in Xen hypervisor.
I quickly read it. It is interesting to see that EC2 suffers from such issue. According to 4.1, it seems to me that this is more like a scheduler "bug" in budget accounting logic.
It's from March 2011. I was pretty new to Xen at the time, I'm sure George knows better.
IIRC, is that it's a known attack vector and it's been fixed. I can look at the paper and dig in the code and find proper references during during this coming week, when back from time-off, but you probably can verify it yourself, if you look carefully.
When the attack VCPU wake up, the scheduler should starts to counting all time consumed from now on for the attack VM, instead of the victim VM. When the attack VCPU sleeps, the scheduler should accounts the budget consumed for the attack VM.
In the event-driven RTDS scheduler, this issue should not happen. The scheduler did account the budget for the correct VMs, IIRC. Is there any experiment showing that RTDS scheduler suffers this issue?
I'm sure this is not an issue for neither RTDS nor Credit2. But it's most likely not an issue any longer either for Credit.
Refards, Dario
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 11 lines · Dario Faggioli
Il 08 gen 2017 08:31, Meng Xu <[email protected]> ha scritto:
[cc. Dario and George]Quoted 1 line · On Fri, Jan 6, 2017 at 1:34 PM, wy11 <[email protected]> wrote:
Recently I read a paper about possible theft of service attacks in
Xen
Quoted 3 lines
hypervisor.
IIRC, is that it's a known attack vector and it's been fixed.
And it appears I was remembering right. Check commit 78c9b2a64b38ee72cc4d3ea9e93a1a5d224ed822 "Accurate accounting for credit scheduler", from George, in August 2009.
The changelog says:
Rather than debit a full 10ms of credit on a scheduler tick (probabilistic), debit credits accurately based on time stamps.
The main problem this is meant to address is an attack on the scheduler that allows a rogue guest to avoid ever being debited credits. The basic idea is that the rogue process checks time (using rdtsc) periodically, and yields after 9.5ms. Using this technique, a guest can "steal" 95% of the cpu. This is particularly an issue in cloud environments.
So, that's the reaction to exactly the attack vector described in the paper being found and reported, and it closes the hole by precisely accounting how much credits a vCPU consumes.
It does it with full nanoseconds granularity, and it does it precisely.
So, the final and conclusive answer to your doubt is that _none_ of the existing Xen scheduler (Credit, Credit2 or RTDS) are affected by the problem described in the paper, and you can use whichever one you like, with no fear. :-)
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Thank you very much!
Best Regards,
Wenqiu
Quoting Dario Faggioli <[email protected]>:
Quoted 39 lines · Dario Faggioli
Quoted 11 lines
Il 08 gen 2017 08:31, Meng Xu <[email protected]> ha scritto:
[cc. Dario and George]Quoted 1 line · On Fri, Jan 6, 2017 at 1:34 PM, wy11 <[email protected]> wrote:
Recently I read a paper about possible theft of service attacks in
Xen
Quoted 3 lines
hypervisor.
IIRC, is that it's a known attack vector and it's been fixed.
And it appears I was remembering right. Check commit
78c9b2a64b38ee72cc4d3ea9e93a1a5d224ed822"Accurate accounting for credit scheduler", from George, in August 2009.The changelog says:
Rather than debit a full 10ms of credit on a scheduler tick (probabilistic), debit credits accurately based on time stamps.
The main problem this is meant to address is an attack on the scheduler that allows a rogue guest to avoid ever being debited credits. The basic idea is that the rogue process checks time (using rdtsc) periodically, and yields after 9.5ms. Using this technique, a guest can "steal" 95% of the cpu. This is particularly an issue in cloud environments.So, that's the reaction to exactly the attack vector described in the paper being found and reported, and it closes the hole by precisely accounting how much credits a vCPU consumes.
It does it with full nanoseconds granularity, and it does it precisely.
So, the final and conclusive answer to your doubt is that _none_ of the existing Xen scheduler (Credit, Credit2 or RTDS) are affected by the problem described in the paper, and you can use whichever one you like, with no fear. :-)
Quoted 7 lines
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel