-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: verifier: initialize imm in kfunc_tab in add_kfunc_call() #6344
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
bpf: verifier: initialize imm in kfunc_tab in add_kfunc_call() #6344
Conversation
|
Upstream branch: 3249e8a |
|
Upstream branch: 3249e8a |
ca33d7b to
f36c9c8
Compare
4eb9670 to
e1b05fd
Compare
|
Upstream branch: f1d8c65 |
f36c9c8 to
96d9e1c
Compare
e1b05fd to
b1af442
Compare
|
Upstream branch: 93ce3be |
96d9e1c to
f97566e
Compare
b1af442 to
67d3dd3
Compare
|
Upstream branch: 93ce3be |
f97566e to
c1a3cc1
Compare
67d3dd3 to
488318d
Compare
|
Upstream branch: c1da3df |
c1a3cc1 to
99a3adf
Compare
488318d to
728ac5f
Compare
|
Upstream branch: fea3f5e |
99a3adf to
5ddb2a1
Compare
728ac5f to
4fcc7e1
Compare
|
Upstream branch: 63066b7 |
5ddb2a1 to
eda16b4
Compare
4fcc7e1 to
1aeb398
Compare
|
Upstream branch: c133390 |
eda16b4 to
82d62b8
Compare
1aeb398 to
f68d848
Compare
|
Upstream branch: ef2c0b2 |
82d62b8 to
23cc0ff
Compare
f68d848 to
3fd24de
Compare
Metadata about a kfunc call is added to the kfunc_tab in add_kfunc_call() but the call instruction itself could get removed by opt_remove_dead_code() later if it is not reachable. If the call instruction is removed, specialize_kfunc() is never called for it and the desc->imm in the kfunc_tab is never initialized for this kfunc call. In this case, sort_kfunc_descs_by_imm_off(env->prog); in do_misc_fixups() doesn't sort the table correctly. This is a problem from s390 as its JIT uses this table to find the addresses for kfuncs, and if this table is not sorted properly, JIT can fail to find addresses for valid kfunc calls. This was exposed by: commit d869d56 ("bpf: verifier: refactor kfunc specialization") as before this commit, desc->imm was initialised in add_kfunc_call(). Initialize desc->imm in add_kfunc_call(), it will be overwritten with new imm in specialize_kfunc() if the instruction is not removed. Signed-off-by: Puranjay Mohan <[email protected]> Acked-by: Kumar Kartikeya Dwivedi <[email protected]>
|
Upstream branch: a4d31f4 |
23cc0ff to
20a3d98
Compare
3fd24de to
22f76ea
Compare
|
Upstream branch: 4f7bc83 Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/netdevbpf/list/?series=1022898 conflict: |
Pull request for series with
subject: bpf: verifier: initialize imm in kfunc_tab in add_kfunc_call()
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1022898