Commit f6606a4
bpf, arm64: Emit BTI for indirect jump target
On CPUs that support BTI, the indirect jump selftest triggers a kernel
panic because there is no BTI instructions at the indirect jump targets.
Fix it by emitting a BTI instruction for each indirect jump target.
For reference, below is a sample panic log.
Internal error: Oops - BTI: 0000000036000003 [#1] SMP
...
Call trace:
bpf_prog_2e5f1c71c13ac3e0_big_jump_table+0x54/0xf8 (P)
bpf_prog_run_pin_on_cpu+0x140/0x468
bpf_prog_test_run_syscall+0x280/0x3b8
bpf_prog_test_run+0x22c/0x2c0
Fixes: f4a66cf ("bpf: arm64: Add support for indirect jumps")
Reviewed-by: Anton Protopopov <a.s.protopopov@gmail.com> # v8
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com> # v12
Acked-by: Leon Hwang <leon.hwang@linux.dev>
Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/20260416064341.151802-6-xukuohai@huaweicloud.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 9a0e89d commit f6606a4
1 file changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
1200 | | - | |
1201 | | - | |
| 1200 | + | |
| 1201 | + | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
| |||
1223 | 1223 | | |
1224 | 1224 | | |
1225 | 1225 | | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1226 | 1229 | | |
1227 | 1230 | | |
1228 | 1231 | | |
| |||
1898 | 1901 | | |
1899 | 1902 | | |
1900 | 1903 | | |
1901 | | - | |
| 1904 | + | |
1902 | 1905 | | |
1903 | 1906 | | |
1904 | 1907 | | |
| |||
1917 | 1920 | | |
1918 | 1921 | | |
1919 | 1922 | | |
1920 | | - | |
| 1923 | + | |
1921 | 1924 | | |
1922 | 1925 | | |
1923 | 1926 | | |
| |||
2073 | 2076 | | |
2074 | 2077 | | |
2075 | 2078 | | |
2076 | | - | |
| 2079 | + | |
2077 | 2080 | | |
2078 | 2081 | | |
2079 | 2082 | | |
| |||
2121 | 2124 | | |
2122 | 2125 | | |
2123 | 2126 | | |
2124 | | - | |
| 2127 | + | |
2125 | 2128 | | |
2126 | 2129 | | |
2127 | 2130 | | |
| |||
2130 | 2133 | | |
2131 | 2134 | | |
2132 | 2135 | | |
2133 | | - | |
| 2136 | + | |
2134 | 2137 | | |
2135 | 2138 | | |
2136 | 2139 | | |
| |||
0 commit comments