This doesn't seem to fix a regression -- I don't think the CLAC was
ever there.

I double-checked in a debugger: entries through the int80 gate do
not automatically clear AC.

Stable maintainers: I can provide a backport to 4.3 and earlier if
needed.  This needs to be backported all the way to 3.10.

Reported-by: Brian Gerst <brge...@gmail.com>
Cc: sta...@vger.kernel.org
Fixes: 63bcff2a307b ("x86, smap: Add STAC and CLAC instructions to control user 
space access")
Signed-off-by: Andy Lutomirski <l...@kernel.org>
---
 arch/x86/entry/entry_64_compat.S | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S
index 5e887ee35662..41fbb3389a2f 100644
--- a/arch/x86/entry/entry_64_compat.S
+++ b/arch/x86/entry/entry_64_compat.S
@@ -261,6 +261,7 @@ ENTRY(entry_INT80_compat)
         * Interrupts are off on entry.
         */
        PARAVIRT_ADJUST_EXCEPTION_FRAME
+       ASM_CLAC                        /* Do this early to minimize exposure */
        SWAPGS
 
        /*
-- 
2.5.0

Reply via email to