• Daniel Borkmann's avatar
    bpf, selftests: Adjust few selftest outcomes wrt unreachable code · 973377ff
    Daniel Borkmann authored
    In almost all cases from test_verifier that have been changed in here, we've
    had an unreachable path with a load from a register which has an invalid
    address on purpose. This was basically to make sure that we never walk this
    path and to have the verifier complain if it would otherwise. Change it to
    match on the right error for unprivileged given we now test these paths
    under speculative execution.
    
    There's one case where we match on exact # of insns_processed. Due to the
    extra path, this will of course mismatch on unprivileged. Thus, restrict the
    test->insn_processed check to privileged-only.
    
    In one other case, we result in a 'pointer comparison prohibited' error. This
    is similarly due to verifying an 'invalid' branch where we end up with a value
    pointer on one side of the comparison.
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
    Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
    973377ff
and.c 2.25 KB