module: ovs: fix return value in raw tracepoint program #332
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the upcoming Linux v6.8 and commit c871d0e00f0e ("bpf: enforce precise retval range on program exit") returned value of programs are enforced to be in specific ranges. For tracepoints the range is [0, 0]; meaning programs should always return 0.
This is an issue in Retis as we load hooks as programs and they sometimes return non-0 values. When this happens and the hook is used in a raw tracepoint, the following error message is issued:
At program exit the register R0 has smin=-1 smax=-1 should have been in [0, 0]
So far only a single hook is problematic, kernel_upcall_tp. For completeness, this patch also converts other kernel hooks to not return custom values. This fixes our runtime CI tests on Rawhide.
This alone is not sufficient. While returning custom errors is problematic even for Retis (those are not handled), we allow hooks to return -ENOMSG. This should be handled in another rework. Luckily the only user is quite contained for now and is a kprobe (nft module).