Skip to content

Commit 5bfdb4f

Browse files
kkdwvdAlexei Starovoitov
authored andcommitted
bpf: Disable exceptions when CONFIG_UNWINDER_FRAME_POINTER=y
The build with CONFIG_UNWINDER_FRAME_POINTER=y is broken for current exceptions feature as it assumes ORC unwinder specific fields in the unwind_state. Disable exceptions when frame_pointer unwinder is enabled for now. Fixes: fd5d27b ("arch/x86: Implement arch_bpf_stack_walk") Reported-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20230918155233.297024-4-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 7d34606 commit 5bfdb4f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

arch/x86/net/bpf_jit_comp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,16 +3003,15 @@ void bpf_jit_free(struct bpf_prog *prog)
30033003
bool bpf_jit_supports_exceptions(void)
30043004
{
30053005
/* We unwind through both kernel frames (starting from within bpf_throw
3006-
* call) and BPF frames. Therefore we require one of ORC or FP unwinder
3007-
* to be enabled to walk kernel frames and reach BPF frames in the stack
3008-
* trace.
3006+
* call) and BPF frames. Therefore we require ORC unwinder to be enabled
3007+
* to walk kernel frames and reach BPF frames in the stack trace.
30093008
*/
3010-
return IS_ENABLED(CONFIG_UNWINDER_ORC) || IS_ENABLED(CONFIG_UNWINDER_FRAME_POINTER);
3009+
return IS_ENABLED(CONFIG_UNWINDER_ORC);
30113010
}
30123011

30133012
void arch_bpf_stack_walk(bool (*consume_fn)(void *cookie, u64 ip, u64 sp, u64 bp), void *cookie)
30143013
{
3015-
#if defined(CONFIG_UNWINDER_ORC) || defined(CONFIG_UNWINDER_FRAME_POINTER)
3014+
#if defined(CONFIG_UNWINDER_ORC)
30163015
struct unwind_state state;
30173016
unsigned long addr;
30183017

0 commit comments

Comments
 (0)