]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "selftests/bpf: dummy_st_ops should reject 0 for non-nullable params"
authorShung-Hsi Yu <shung-hsi.yu@suse.com>
Thu, 17 Jul 2025 08:09:25 +0000 (16:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:53:22 +0000 (08:53 +0200)
This reverts commit e7d193073a223663612301c659e53795b991ca89 which is
commit 6a2d30d3c5bf9f088dcfd5f3746b04d84f2fab83 upstream.

The dummy_st_ops/dummy_sleepable_reject_null test requires commit 980ca8ceeae6
("bpf: check bpf_dummy_struct_ops program params for test runs"), which in turn
depends on "Support PTR_MAYBE_NULL for struct_ops arguments" series (see link
below), neither are backported to stable 6.6.

Link: https://lore.kernel.org/all/20240209023750.1153905-1-thinker.li@gmail.com/
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/prog_tests/dummy_st_ops.c

index d3d94596ab79cf0f4b1d78a60a03b69231da17f4..dd926c00f41469d9ddf818c1c379eb9e4820ebbe 100644 (file)
@@ -147,31 +147,6 @@ static void test_dummy_sleepable(void)
        dummy_st_ops_success__destroy(skel);
 }
 
-/* dummy_st_ops.test_sleepable() parameter is not marked as nullable,
- * thus bpf_prog_test_run_opts() below should be rejected as it tries
- * to pass NULL for this parameter.
- */
-static void test_dummy_sleepable_reject_null(void)
-{
-       __u64 args[1] = {0};
-       LIBBPF_OPTS(bpf_test_run_opts, attr,
-               .ctx_in = args,
-               .ctx_size_in = sizeof(args),
-       );
-       struct dummy_st_ops_success *skel;
-       int fd, err;
-
-       skel = dummy_st_ops_success__open_and_load();
-       if (!ASSERT_OK_PTR(skel, "dummy_st_ops_load"))
-               return;
-
-       fd = bpf_program__fd(skel->progs.test_sleepable);
-       err = bpf_prog_test_run_opts(fd, &attr);
-       ASSERT_EQ(err, -EINVAL, "test_run");
-
-       dummy_st_ops_success__destroy(skel);
-}
-
 void test_dummy_st_ops(void)
 {
        if (test__start_subtest("dummy_st_ops_attach"))
@@ -184,8 +159,6 @@ void test_dummy_st_ops(void)
                test_dummy_multiple_args();
        if (test__start_subtest("dummy_sleepable"))
                test_dummy_sleepable();
-       if (test__start_subtest("dummy_sleepable_reject_null"))
-               test_dummy_sleepable_reject_null();
 
        RUN_TESTS(dummy_st_ops_fail);
 }