Skip to content

Conversation

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

Pull request for series with
subject: bpf: Add preempt_disable to protect get_perf_callchain
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1006619

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

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

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

Upstream branch: 991e555
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1006619
version: 2

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

Upstream branch: 0cc114d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1006619
version: 2

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

Upstream branch: 0cc114d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1006619
version: 2

As Alexei noted, get_perf_callchain() return values may be reused
if a task is preempted after the BPF program enters migrate disable
mode. We therefore use bpf_perf_callchain_entries percpu entries
similarly to bpf_try_get_buffers to preserve the current task's
callchain and prevent overwriting by preempting tasks. And we also
add preempt_disable to protect get_perf_callchain.

Reported-by: Alexei Starovoitov <[email protected]>
Closes: https://lore.kernel.org/bpf/CAADnVQ+s8B7-fvR1TNO-bniSyKv57cH_ihRszmZV7pQDyV=VDQ@mail.gmail.com
Signed-off-by: Tao Chen <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1006619 expired. 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.

1 participant