4 ms·
Is that actually true? Wouldn’t this imply you could launch a DOS attack against cloud providers just generating divisions by zero?
by vlovich123 5y ago
Is that actually true? Wouldn’t this imply you could launch a DOS attack against cloud providers just generating divisions by zero?
- bonzini 5y agoYou would only attack yourself. The CPU time you're paying for would be spent processing division by zero exceptions.
- vlovich123 5y agoThen the CPU isn’t stopping and is moving on doing other work. Meaning the divide by zero could be processed by a background CPU and doesn’t require immediate handling. Same for page faults.
- bonzini 5y agoYour instance can still be preempted by the hypervisor.
- fulafel 5y agoThe hypervisor is just some software that runs on the same CPU. It wouldn't help if the assertion that the CPU can't continue was true.
- bonzini 5y agoThe CPU can't continue running user code because it jumps to the exception handler. But it can get to the hypervisor at any instruction boundary. (I write a hypervisor for a living :)).
- bananabreakfast 5y agoIncorrect. The "CPU" is stopping and handling the fault. There is no background CPU from your perspective. In a cloud provider you are always in a virtual environment and using a vCPU which is constantly being preempted by the hypervisor. You cannot DOS a hypervisor just by bogging down your virtualized kernel.
- bonzini 5y agoThere are a couple x86 corner cases where you can do so, by causing an endless stream of exceptions. But they are not going to happen in a hot path, so the hypervisors force a vmexit on those exceptions and avoid that the processor freezes forever.
- zaptheimpaler 5y agoThe divide by zero in this case is handled by a virtual CPU implemented in the hypervisor, not the actual physical CPU on the server.
- imtringued 5y agoA site that renders HTML is more computationally expensive than handling a site that does nothing but division by zero.
- fulafel 5y agoThere are mechanisms that can intercede, and there are often more than one cpu thread per core.