From deec799746e92ab0487eca489499ade08a2610bf Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Mon, 8 Jan 2018 10:25:12 -0800 Subject: [GCC] Commit retpoline patch code, for fixing security issues. This applies the Intel GCC code patches, to allow compiling with appropriate flags for mitigating the indirect branch variant of the speculative execution security flaw. Bug: None Test: This is already in place in ChromeOS and has been tested on the ChromeOS kernels. Change-Id: Ideffb433b697f1fe7e4ca2c1eaa968160abfcc8b --- gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c') diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c new file mode 100644 index 000000000..68c22122f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mfunction-return=keep" } */ + +void +foo (void) +{ +} + +/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86.return_thunk" } } */ +/* { dg-final { scan-assembler-not {\tlfence} } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ +/* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ -- cgit v1.2.3 From d64d815b3af9d2653d924ea2e1ebb21ee8b043b7 Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Mon, 29 Jan 2018 13:36:52 -0800 Subject: [GCC] Update with latest retpoline fixes from Intel. Intel has updated their retpoline patches since we created our original patch. This CL updates our retpoline changes to match the latest from Intel. Bug: None Test: Tested extensively in ChromeOS. Built x86 platform & kernel images in Android. Change-Id: Id1a18cb1f1f4461832a017cb5c5d59e5400d9d08 --- gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c') diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c index 68c22122f..9ae37e835 100644 --- a/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c +++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/ret-thunk-4.c @@ -6,7 +6,7 @@ foo (void) { } -/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86.return_thunk" } } */ -/* { dg-final { scan-assembler-not {\tlfence} } } */ +/* { dg-final { scan-assembler-not "jmp\[ \t\]*__x86_return_thunk" } } */ +/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */ /* { dg-final { scan-assembler-not "jmp\[ \t\]*\.LIND" } } */ /* { dg-final { scan-assembler-not "call\[ \t\]*\.LIND" } } */ -- cgit v1.2.3