Find all ENDBR instructions which are never referenced and stick them in a section such that the kernel can poison them, sealing the functions from ever being an indirect call target. This removes about 1-in-4 ENDBR instructions.
Showing the changes to tools/objtool/include (1 of 4 files). Show all
Unified · Split
| @@ -26,6 +26,7 @@ struct objtool_file { · 25 unmodified lines | ||
| 26 | 26 | struct list_head retpoline_call_list; |
| 27 | 27 | struct list_head static_call_list; |
| 28 | 28 | struct list_head mcount_loc_list; |
| 29 | + struct list_head endbr_list; | |
| 29 | 30 | bool ignore_unreachables, c_file, hints, rodata; |
| 30 | 31 | |
| 31 | 32 | unsigned int nr_endbr; |