Files
Linux/include/linux
Peter Zijlstra a09a6e2399 objtool: Add entry UNRET validation
Since entry asm is tricky, add a validation pass that ensures the
retbleed mitigation has been done before the first actual RET
instruction.

Entry points are those that either have UNWIND_HINT_ENTRY, which acts
as UNWIND_HINT_EMPTY but marks the instruction as an entry point, or
those that have UWIND_HINT_IRET_REGS at +0.

This is basically a variant of validate_branch() that is
intra-function and it will simply follow all branches from marked
entry points and ensures that all paths lead to ANNOTATE_UNRET_END.

If a path hits RET or an indirection the path is a fail and will be
reported.

There are 3 ANNOTATE_UNRET_END instances:

 - UNTRAIN_RET itself
 - exception from-kernel; this path doesn't need UNTRAIN_RET
 - all early exceptions; these also don't need UNTRAIN_RET

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Josh Poimboeuf <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
2022-06-27 10:34:00 +02:00
..
…
…
…
…
2022-05-10 16:03:52 +08:00
…
…
…
…
…
…
…
…
…
…
2022-05-22 20:44:29 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-08 14:04:14 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-20 15:29:00 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-16 13:37:59 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-03 06:52:57 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-13 07:20:18 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-02 14:06:20 -06:00
…
2022-06-27 10:33:58 +02:00
…
…
…
…
…
…
2022-06-06 09:52:17 +09:00
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-03 16:09:03 -04:00
…
…
…
…
…
…
…
…
…
…
…
2022-05-19 14:08:53 -07:00
…
…
…
…
…
2022-05-13 07:20:17 -07:00
…
…
…
…
…
2022-04-28 23:16:14 -07:00
…
2022-05-12 10:29:41 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-17 13:32:46 -04:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-27 10:34:00 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-10 11:29:48 +02:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-22 21:03:01 +01:00
…
…
…
…
…
…
…
…
…
…
…
…
2022-06-02 10:15:05 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-08 01:33:08 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
2022-05-24 08:41:18 -06:00
…
…
…
…
2022-05-31 12:45:10 -04:00
…
2022-06-13 09:54:52 -07:00
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…