• caglararli@hotmail.com
  • 05386281520

Can a process be DoSed by interfering with its compare-exchange loops?

Çağlar Arlı      -    61 Views

Can a process be DoSed by interfering with its compare-exchange loops?

Consider a file accessed by multiple processes; the processes map the file to memory and then use lock-free operations to synchronize (for example, use atomic-add to allocate an offset in the file to write to).

The atomic operations might be lock-free, but not wait-free. On x86 for example, atomic-max would be implemented as a compare-exchange loop (fetch previous value, compute the new maximum, compare-exchange, repeat if the previous value changed). Now, a malicious process could hammer the memory location with writes to make the compare-exchange constantly fail, thus blocking the other processes forever.

Is this a real issue that I need to protect against? Or does the unpredictable timing of modern processors make such attacks impossible?