Skip to content
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

selftests/bpf: Fix freplace_link segfault in tailcalls prog test #8387

Closed
wants to merge 1 commit into from

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: selftests/bpf: Fix freplace_link segfault in tailcalls prog test
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=927230

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: c45323b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=927230
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 7569fc9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=927374
version: 2

There are two bpf_link__destroy(freplace_link) calls in
test_tailcall_bpf2bpf_freplace(). After the first bpf_link__destroy()
is called, if the following bpf_map_{update,delete}_elem() throws an
exception, it will jump to the "out" label and call bpf_link__destroy()
again, causing double free and eventually leading to a segfault.

Fix it by directly resetting freplace_link to NULL after the first
bpf_link__destroy() call.

Fixes: 021611d ("selftests/bpf: Add test to verify tailcall and freplace restrictions")
Signed-off-by: Tengda Wu <[email protected]>
Reviewed-by: Leon Hwang <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/927230=>bpf branch January 24, 2025 18:46
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.

0 participants