Commit 1e4d300
x86/entry: Harden return-to-user
Make the CONFIG_DEBUG_ENTRY=y check that validates CS is a user segment
unconditional and move it nearer to IRET.
PRE:
140,026,608 cycles:k ( +- 0.01% )
236,696,176 instructions:k # 1.69 insn per cycle ( +- 0.00% )
POST:
139,957,681 cycles:k ( +- 0.01% )
236,681,819 instructions:k # 1.69 insn per cycle ( +- 0.00% )
(this is with --repeat 100 and the run-to-run variance is bigger than
the difference shown)
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20231120143626.753200755@infradead.org1 parent c516213 commit 1e4d300
1 file changed
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | 562 | | |
570 | 563 | | |
571 | 564 | | |
| |||
576 | 569 | | |
577 | 570 | | |
578 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
579 | 575 | | |
580 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
581 | 580 | | |
582 | 581 | | |
583 | 582 | | |
| |||
613 | 612 | | |
614 | 613 | | |
615 | 614 | | |
616 | | - | |
617 | | - | |
| 615 | + | |
618 | 616 | | |
619 | 617 | | |
620 | 618 | | |
| |||
0 commit comments