Re: [PATCH bpf-next v5 3/3] selftests/bpf: Skip callback tests if jit is disabled in test_verifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 17, 2024 at 3:10 AM Tiezhu Yang <yangtiezhu@xxxxxxxxxxx> wrote:
>
[...]
> @@ -1622,6 +1624,16 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
>         alignment_prevented_execution = 0;
>
>         if (expected_ret == ACCEPT || expected_ret == VERBOSE_ACCEPT) {
> +               if (fd_prog < 0 && saved_errno == EINVAL && jit_disabled) {
> +                       for (i = 0; i < prog_len; i++, prog++) {
> +                               if (!insn_is_pseudo_func(prog))
> +                                       continue;
> +                               printf("SKIP (callbacks are not allowed in non-JITed programs)\n");
> +                               skips++;
> +                               goto close_fds;
> +                       }
> +               }
> +

I would put this chunk above "alignment_prevented_execution = 0;".

@@ -1619,6 +1621,16 @@ static void do_test_single(struct bpf_test
*test, bool unpriv,
                goto close_fds;
        }

+       if (fd_prog < 0 && saved_errno == EINVAL && jit_disabled) {
+               for (i = 0; i < prog_len; i++, prog++) {
+                       if (!insn_is_pseudo_func(prog))
+                               continue;
+                       printf("SKIP (callbacks are not allowed in
non-JITed programs)\n");
+                       skips++;
+                       goto close_fds;
+               }
+       }
+
        alignment_prevented_execution = 0;

        if (expected_ret == ACCEPT || expected_ret == VERBOSE_ACCEPT) {

Other than this,

Acked-by: Song Liu <song@xxxxxxxxxx>

Thanks,
Song





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux