Commit c1fcd45
authored
JIT: Add IBT support (#8636)
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.
This commit adds IBT support for JIT:
1. Add endbr32/64 instruction in Dynasm.
2. Insert endbr32/64 in indirect branch target for jitted code.
gcc support CET since v8.1 and set it to default since gcc 11. With this
commit, endbr is inserted in jitted code if PHP is compiled with "gcc
-fcf-protection=full/branch".
Signed-off-by: Chen, Hu <[email protected]>1 parent 2d1a320 commit c1fcd45
2 files changed
+15
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
1626 | 1636 | | |
1627 | 1637 | | |
1628 | 1638 | | |
| |||
2292 | 2302 | | |
2293 | 2303 | | |
2294 | 2304 | | |
| 2305 | + | |
2295 | 2306 | | |
2296 | 2307 | | |
2297 | 2308 | | |
| |||
2362 | 2373 | | |
2363 | 2374 | | |
2364 | 2375 | | |
| 2376 | + | |
2365 | 2377 | | |
2366 | 2378 | | |
2367 | 2379 | | |
| |||
3049 | 3061 | | |
3050 | 3062 | | |
3051 | 3063 | | |
| 3064 | + | |
3052 | 3065 | | |
3053 | 3066 | | |
3054 | 3067 | | |
| |||
0 commit comments