Unverified Commit df79d3bf authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10805 dummy_struct_ops selftest failed

Merge Pull Request from: @ci-robot 
 
PR sync from: Pu Lehui <pulehui@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/AAYZNE4HZDPDNX6GHC2WDVGYQT3KEWYH/ 
Pu Lehui (2):
  Revert "[Backport] selftests/bpf: dummy_st_ops should reject 0 for
    non-nullable params"
  Revert "[Backport] selftests/bpf: adjust dummy_st_ops_success to
    detect additional error"


-- 
2.34.1
 
https://gitee.com/openeuler/kernel/issues/IAIM4R 
 
Link:https://gitee.com/openeuler/kernel/pulls/10805

 

Reviewed-by: default avatarXu Kuohai <xukuohai@huawei.com>
Reviewed-by: default avatarYe Weihua <yeweihua4@huawei.com>
Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents ef90effa 9a35bd9e
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -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);
}
+2 −11
Original line number Diff line number Diff line
@@ -11,17 +11,8 @@ int BPF_PROG(test_1, struct bpf_dummy_ops_state *state)
{
	int ret;

	/* Check that 'state' nullable status is detected correctly.
	 * If 'state' argument would be assumed non-null by verifier
	 * the code below would be deleted as dead (which it shouldn't).
	 * Hide it from the compiler behind 'asm' block to avoid
	 * unnecessary optimizations.
	 */
	asm volatile (
		"if %[state] != 0 goto +2;"
		"r0 = 0xf2f3f4f5;"
		"exit;"
	::[state]"p"(state));
	if (!state)
		return 0xf2f3f4f5;

	ret = state->val;
	state->val = 0x5a;