Spectre and Meltdown: A new breed of vulnerability

January 23, 2018

Blog

Spectre and Meltdown: A new breed of vulnerability

The obvious way to eliminate Spectre/Meltdown vulnerabilities is eliminating the optimizations they exploit. But the reason these CPU optimizations exist ? they dramatically increase performance!

The Spectre and Meltdown vulnerabilities have caused a big wave in the electronics industry as of late. What’s interesting about this vulnerability is that it takes advantage of microprocessor behavior – not an operating system (OS) software bug or back door. Both of these vulnerabilities involve exploiting processor instruction pipelining, which makes them particularly nasty.

A brief overview of Spectre and Meltdown

The Spectre vulnerability takes advantage of branch prediction characteristics of the CPU instruction pipeline. When a branch instruction is executed, running the calculation that determines the branch path in real-time would normally result in stall cycles in the instruction pipeline. To avoid these stall cycles, processors use branch prediction during idle cycles to assume the branch path before the actual branch calculation takes place. If the prediction is right, cycles are saved. If not, no harm – the processor executes the branched-to instructions.

With the Spectre vulnerability, however, security analysts from Google’s Project Zero team discovered that they could use this branch prediction procedure to read unauthorized data during program execution. So far, Spectre has been proven on Intel, AMD, IBM, and ARM-based processors.

The Meltdown vulnerability similarly attacks optimizations in new CPUs by exploiting a race condition that exists between memory access and privilege checking during the instruction processing phase. Because most OSs map physical memory, kernel processes, and other user space memory into the address space of every application under the assumption that privilege checks will prevent access to restricted memory regions, Meltdown essentially allows software applications to read data from unauthorized memory. In fact, the Meltdown vulnerability potentially allows access to all of a device’s memory!

Industry’s response and an inconvenient truth: Performance degradation

These vulnerabilities have and are being addressed in a variety of ways. The most obvious way to eliminate the problem(s) is by eliminating the optimizations they exploit. Of course, there is a reason these CPU optimizations exist in the first place – they dramatically increase performance!

No matter how you “slice” things (excuse the pun), correcting these vulnerabilities is going to lead to a performance hit. And, since these optimizations and vulnerabilities are a function of the instruction set pipelining of the microprocessor, this performance hit will be more than just a chunk of code that can be fixed in an OS. So, in addition to the Spectre and Meltdown security fallout, the aftermath in terms of performance degradation will be equally significant.

Jim D’Arezzo, CEO at Condusiv Technologies and a 35-year veteran of the electronics industry with stints at IBM, Compaq, and Autodesk, has recognized that while the vulnerabilities were significant enough for chipmakers and OS companies to update their firmware, that isn’t where things end. Even after chip companies issued Spectre and Meltdown patches, steps still need to be taken to recover lost performance.

“PC World said Intel published some post-patch benchmarks showing a best-case performance loss of 2-7 percent,” D’Arezzo says. “System responsiveness scores that measure common user pain points took a 14 percent hit. Web applications with JavaScript reported a 7-10 percent performance loss post-patch. While these tests were performed on a SSD-based system and are less noticeable when using a traditional hard drive, the numbers are still significant.”

D’Arezzo goes on to correlate this CPU performance loss to business productivity.

“For the sake of argument, let’s [assume a] 5 percent loss for the average PC user,” he says. “5 percent of an hour is 3 minutes. An average office worker uses a computer about 4 hours per day. Let’s say the cost per hour [loaded] is $60. Taking 12 minutes out of a day is $12 per day. For 126 million workers in the US, half being office workers, that’s seven hundred and twenty million dollars per day!”

If you think this number is astounding for a worker using a computer 4 hours per day, consider an Internet of Things (IoT) application or web service with stacks of servers in the cloud running 24x7!

Reclaiming lost performance

Considering these numbers, it’s perhaps just as important to consider how to gain back the performance lost from vulnerabilities. Condusiv’s V-locity I/O reduction software is one way to deal with this.

V-locity software helps resolve I/O inefficiencies by utilizing existing system DRAM and two patented engines (“IntelliMemory” for read caching and “IntelliWrite” for write optimization) to cache frequent read operations and to create large, clean, contiguous read and write operations. This approach enables what D’Arezzo refers to as “Tier 0 caching,” as the V-locity software sets up DRAM for caching during idle processor cycles so that the CPU can still access memory when need be without the engines interfering. The same principle applies to both read and write operations, and the technology has been benchmarked at up to 15x faster than SSD alternatives.

“[The IntelliMemory and IntelliWrite] engines increase performance by an average of 50 percent, with some results being as high as 10x initial performance,” D’Arezzo says.

Software solutions like V-locity provide an effective way to regain lost performance in desktop PCs, as well as virtual and physical servers that are critical for today’s IoT and cloud deployments. Depending on the application and environment, they may even be able to provide additional performance gains. The Condusiv website includes a “Time Saved” dashboard” and other helpful utilities that indicate where performance gains are to be had.

Back to the drawing board?

The Spectre and Meltdown vulnerabilities represent a concerning and dangerous trend in unauthorized data access, which is likely to generate some re-thinking of CPU engineering and architectures as processor roadmaps evolve. While the nature of the vulnerabilities will have a greater impact on microprocessor optimizations that target desktops and the enterprise, embedded and IoT systems must also consider potential threats and performance losses to stay up and running properly.


Categories
Software & OS