The interpreter returns only the low 32 bits of the return value of a program, while the trampoline passes all 64 bits to the caller of the function. If an fmod_ret program on a found target which returns long is interpreted, then a valid return value like -14 reaches the caller as 4294967282. This value is not 0, so the function is skipped, and it is not an error either. Require the JIT for such programs, as for other features which the interpreter does not support. The caller of a function which returns int reads only the low 32 bits, so nothing changes for it. Signed-off-by: Anton Protopopov --- kernel/bpf/verifier.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index b12b57c7403e..920ff39aac42 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -23883,6 +23883,9 @@ static int fmodret_retval_init(struct bpf_verifier_env *env, u32 btf_id, aux->fmodret_retvals = retvals; aux->fmodret_retval_cnt = cnt; + /* The interpreter returns only 32 bits */ + if (size == 8) + env->prog->jit_required = 1; return 0; invalid: -- 2.43.0