Skip to content

bpf: Show precise rejected function when attaching to __noreturn and deny list functions #9342

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

Closed

Conversation

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

Pull request for series with
subject: bpf: Show precise rejected function when attaching to __noreturn and deny list functions
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=984770

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=984770
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=984770
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=984770
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=984770
version: 3

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 95993dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 9ea0691
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b7b3500
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: b114fce
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e9f545d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5345e64
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

…__noreturn functions

With this change, we know the precise rejected function name when
attaching fexit/fmod_ret to __noreturn functions from log.

$ ./fexit
libbpf: prog 'fexit': BPF program load failed: -EINVAL
libbpf: prog 'fexit': -- BEGIN PROG LOAD LOG --
Attaching fexit/fmod_ret to __noreturn function 'do_exit' is rejected.

Suggested-by: Leon Hwang <[email protected]>
Signed-off-by: KaFai Wan <[email protected]>
Acked-by: Yafang Shao <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Show the rejected function name when attaching tracing programs to
functions in deny list.

With this change, we know why tracing programs can't attach to functions
like __rcu_read_lock() from log.

$ ./fentry
libbpf: prog '__rcu_read_lock': BPF program load failed: -EINVAL
libbpf: prog '__rcu_read_lock': -- BEGIN PROG LOAD LOG --
Attaching tracing programs to function '__rcu_read_lock' is rejected.

Suggested-by: Leon Hwang <[email protected]>
Signed-off-by: KaFai Wan <[email protected]>
Acked-by: Yafang Shao <[email protected]>
Acked-by: Yonghong Song <[email protected]>
…ns in deny list

The result:

 $ tools/testing/selftests/bpf/test_progs -t tracing_failure/tracing_deny
 #468/3   tracing_failure/tracing_deny:OK
 #468     tracing_failure:OK
 Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: KaFai Wan <[email protected]>
Acked-by: Yonghong Song <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 5b4c54a
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=985629
version: 4

… suite

Delete fexit_noreturns.c files and migrate the cases into
tracing_failure.c files.

The result:

 $ tools/testing/selftests/bpf/test_progs -t tracing_failure/fexit_noreturns
 #467/4   tracing_failure/fexit_noreturns:OK
 #467     tracing_failure:OK
 Summary: 1/1 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: KaFai Wan <[email protected]>
Acked-by: Yonghong Song <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

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

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf bot deleted the series/982041=>bpf-next branch July 29, 2025 02:52
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