Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf, x86/unwind/orc: Support reliable unwinding through BPF stack frames
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: ff34657
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 8f7aa3d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 835a507
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 835a507
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302
version: 2

Introduce a bpf_has_frame_pointer() helper that unwinders can call to
determine whether a given instruction pointer is within the valid frame
pointer region of a BPF JIT program or trampoline (i.e., after the
prologue, before the epilogue).

This will enable livepatch (with the ORC unwinder) to reliably unwind
through BPF JIT frames.

Acked-by: Song Liu <[email protected]>
Acked-and-tested-by: Andrey Grodzovsky<[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
BPF JIT programs and trampolines use a frame pointer, so the current ORC
unwinder strategy of falling back to frame pointers (when an ORC entry
is missing) usually works in practice when unwinding through BPF JIT
stack frames.

However, that frame pointer fallback is just a guess, so the unwind gets
marked unreliable for live patching, which can cause livepatch
transition stalls.

Make the common case reliable by calling the bpf_has_frame_pointer()
helper to detect the valid frame pointer region of BPF JIT programs and
trampolines.

Fixes: ee9f8fc ("x86/unwind: Add the ORC unwinder")
Reported-by: Andrey Grodzovsky <[email protected]>
Closes: https://lore.kernel.org/[email protected]
Acked-by: Song Liu <[email protected]>
Acked-and-tested-by: Andrey Grodzovsky<[email protected]>
Signed-off-by: Josh Poimboeuf <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 835a507
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1030302 irrelevant now. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants