-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: arm64: Fix panic due to missing BTI at indirect jump targets #6429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
bpf: arm64: Fix panic due to missing BTI at indirect jump targets #6429
Conversation
|
Upstream branch: 688b745 |
8c83cb5 to
f015201
Compare
|
Upstream branch: 19f4091 |
beb7891 to
f7f4bd1
Compare
f015201 to
884c5bc
Compare
|
Upstream branch: bd5bdd2 |
f7f4bd1 to
5752fe3
Compare
884c5bc to
4355736
Compare
|
Upstream branch: 34235a3 |
5752fe3 to
88090ba
Compare
4355736 to
5bece43
Compare
|
Upstream branch: c1af446 |
88090ba to
789f597
Compare
5bece43 to
52f5a27
Compare
|
Upstream branch: ff34657 |
When BTI is enabled, the indirect jump selftest triggers BTI exception: 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 __sys_bpf+0x4d8/0x5c8 __arm64_sys_bpf+0x88/0xa8 invoke_syscall+0x80/0x220 el0_svc_common+0x160/0x1d0 do_el0_svc+0x54/0x70 el0_svc+0x54/0x188 el0t_64_sync_handler+0x84/0x130 el0t_64_sync+0x198/0x1a0 This happens because no BTI instruction is generated by the JIT for indirect jump targets. Fix it by emitting BTI instruction for every possible indirect jump targets when BTI is enabled. The targets are identified by traversing all instruction arrays used by the BPF program, since indirect jump targets can only be read from instruction arrays. Fixes: f4a66cf ("bpf: arm64: Add support for indirect jumps") Signed-off-by: Xu Kuohai <[email protected]>
789f597 to
eee082c
Compare
Pull request for series with
subject: bpf: arm64: Fix panic due to missing BTI at indirect jump targets
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1028290