Re: Improve retpoline for Skylake

From: Andy Lutomirski
Date: Mon Jan 15 2018 - 13:11:01 EST




> On Jan 15, 2018, at 10:07 AM, David Woodhouse <dwmw2@xxxxxxxxxxxxx> wrote:
>
>> On Mon, 2018-01-15 at 10:06 -0800, Andy Lutomirski wrote:
>>
>>> Refill or not, you are aware that a correctly timed SMI in a leaf
>>> function will cause the next ret to speculate into userspace, because
>>> there is guaranteed peturbance in the RSB? (On the expectation that the
>>> SMM handler isn't entirely devoid of function calls).
>>
>> Couldn't firmware fill the RSB with a some known safe address, maybe
>> even 0, and then immediately do RSM?
>
> Why don't we just unconditionally declare that *all* firmware that uses
> SMI for anything at all is broken?
>

Because then Intel would need a new reference design for EFI authenticated variables. Of course, this is totally doable and should be done anyway.

Also, Paolo reports that some misdesign or other makes it important to use SMI on CPU hotplug.