x86/build: Unilaterally disable -fcf-protection
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 May 2020 18:18:43 +0000 (19:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 13 May 2020 19:33:42 +0000 (20:33 +0100)
commit3a218961b16f1f4feb1147f56338faf1ac8f5703
treede87b358e17096521377b06db14896c3e6974079
parent1a47731115c2c8eb510e135fa48ed51ad2e94a26
x86/build: Unilaterally disable -fcf-protection

Xen doesn't support CET-IBT yet.  At a minimum, logic is required to enable it
for supervisor use, but the livepatch functionality needs to learn not to
overwrite ENDBR64 instructions.

Furthermore, Ubuntu enables -fcf-protection by default, along with a buggy
version of GCC-9 which objects to it in combination with
-mindirect-branch=thunk-extern (Fixed in GCC 10, 9.4).

Various objects (Xen boot path, Rombios 32 stubs) require .text to be at the
beginning of the object.  These paths explode when .note.gnu.properties gets
put ahead of .text and we end up executing the notes data.

Disable -fcf-protection for all embedded objects.

Reported-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Config.mk