Skip to content
Commit 9d98aa08 authored by Uros Bizjak's avatar Uros Bizjak Committed by Alexei Starovoitov
Browse files

x86/bpf: Fix IP after emitting call depth accounting

Adjust the IP passed to `emit_patch` so it calculates the correct offset
for the CALL instruction if `x86_call_depth_emit_accounting` emits code.
Otherwise we will skip some instructions and most likely crash.

Fixes: b2e9dfe5 ("x86/bpf: Emit call depth accounting if required")
Link: https://lore.kernel.org/lkml/20230105214922.250473-1-joanbrugueram@gmail.com/


Co-developed-by: default avatarJoan Bruguera Micó <joanbrugueram@gmail.com>
Signed-off-by: default avatarJoan Bruguera Micó <joanbrugueram@gmail.com>
Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20240401185821.224068-2-ubizjak@gmail.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 6dae957c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment