Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull gcc-plugins fixes from Kees Cook:
"Fix ARM per-task stack protector plugin under GCC 9 (Ard Biesheuvel)"

* tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+
gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask

+21 -2
+21 -2
scripts/gcc-plugins/arm_ssp_per_task_plugin.c
··· 13 13 for (insn = get_insns(); insn; insn = NEXT_INSN(insn)) { 14 14 const char *sym; 15 15 rtx body; 16 - rtx masked_sp; 16 + rtx mask, masked_sp; 17 17 18 18 /* 19 19 * Find a SET insn involving a SYMBOL_REF to __stack_chk_guard ··· 33 33 * produces the address of the copy of the stack canary value 34 34 * stored in struct thread_info 35 35 */ 36 + mask = GEN_INT(sext_hwi(sp_mask, GET_MODE_PRECISION(Pmode))); 36 37 masked_sp = gen_reg_rtx(Pmode); 37 38 38 39 emit_insn_before(gen_rtx_SET(masked_sp, 39 40 gen_rtx_AND(Pmode, 40 41 stack_pointer_rtx, 41 - GEN_INT(sp_mask))), 42 + mask)), 42 43 insn); 43 44 44 45 SET_SRC(body) = gen_rtx_PLUS(Pmode, masked_sp, ··· 52 51 53 52 #define NO_GATE 54 53 #include "gcc-generate-rtl-pass.h" 54 + 55 + #if BUILDING_GCC_VERSION >= 9000 56 + static bool no(void) 57 + { 58 + return false; 59 + } 60 + 61 + static void arm_pertask_ssp_start_unit(void *gcc_data, void *user_data) 62 + { 63 + targetm.have_stack_protect_combined_set = no; 64 + targetm.have_stack_protect_combined_test = no; 65 + } 66 + #endif 55 67 56 68 __visible int plugin_init(struct plugin_name_args *plugin_info, 57 69 struct plugin_gcc_version *version) ··· 112 98 113 99 register_callback(plugin_info->base_name, PLUGIN_PASS_MANAGER_SETUP, 114 100 NULL, &arm_pertask_ssp_rtl_pass_info); 101 + 102 + #if BUILDING_GCC_VERSION >= 9000 103 + register_callback(plugin_info->base_name, PLUGIN_START_UNIT, 104 + arm_pertask_ssp_start_unit, NULL); 105 + #endif 115 106 116 107 return 0; 117 108 }