Re: [PATCH v5 1/2] x86/speculation: apply IBPB more strictly to avoid cross-process data leak

From: Pavel Machek
Date: Sun Oct 21 2018 - 15:38:42 EST


Hi!

> In order to minimize the performance impact (for usecases that do require
> spectrev2 protection), issue the barrier only in cases when switching between
> processess where the victim can't be ptraced by the potential attacker (as in
> such cases, the attacker doesn't have to bother with branch buffers
> at all).

Testing if attacker can ptrace victim is very good approximation, and
certainly better than "dumpable" check, but it is still not correct.

Imagine JIT running evil code (flash, javascript). JIT will prevent
evil code from doing ptrace() (or maybe there is syscall filter in
effect or something like that), but if evil code can poison branch
buffers and do timings, security problem stays.

Do we need prctl(I_DONT_RUN_EVIL_CODE)?

Or maybe we should just do barrier unconditionally for now?

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature