Skip to contentSkip to conversation

x86/enter: Use IBRS on syscall and interrupts

PATCH Dr. David Alan Gilbert 2 participants 2 messages Jan 5, 2018

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines
Quoted 11 lines · Dave Hansen
Quoted 1 line · Andy Lutomirski

Do we need an arch_prctl() to enable IBRS for user mode?

Eventually, once the dust settles. I think there's a spectrum of paranoia here, that is roughly (with increasing paranoia):

1. do nothing
2. do retpoline
3. do IBRS in kernel
4. do IBRS always

Quoted 6 lines
Quoted 6 lines

I think you're asking for ~3.5.

Patches for 1-3 are out there and 4 is pretty straightforward. Doing a arch_prctl() is still straightforward, but will be a much more niche thing than any of the other choices. Plus, with a user interface, we have to argue over the ABI for at least a month or two. ;)

I was chatting to Andrea about this, and we came to the conclusion one use might be for qemu; I was worried about (theoretically) whether userspace in a guest could read privileged data from the guest kernel by attacking the qemu process rather than by attacking the kernels.

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

#1 lore raw
Quoted 8 lines · Dr. David Alan Gilbert
Quoted 4 lines
Quoted 4 lines

Patches for 1-3 are out there and 4 is pretty straightforward. Doing a arch_prctl() is still straightforward, but will be a much more niche thing than any of the other choices. Plus, with a user interface, we have to argue over the ABI for at least a month or two. ;)

I was chatting to Andrea about this, and we came to the conclusion one use might be for qemu; I was worried about (theoretically) whether userspace in a guest could read privileged data from the guest kernel by attacking the qemu process rather than by attacking the kernels.

Theoretically, I believe it's possible. The SMEP-based mitigations are effective when crossing rings, but do not help with guest-ring0->host-ring0 or presumably guest-ring3->host-ring3.

For the same-ring things, we have the indirect branch predictor flush operation MSR (IBPB). Expect those to be posted once we have the IBRS and retpoline approaches settled.