lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 23 Sep 2020 06:29:05 +0000
From:   Song Liu <songliubraving@...com>
To:     John Fastabend <john.fastabend@...il.com>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        Kernel Team <Kernel-team@...com>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        "kpsingh@...omium.org" <kpsingh@...omium.org>
Subject: Re: [PATCH bpf-next 3/3] selftests/bpf: add raw_tp_test_run

Thanks for the quick review!

> On Sep 22, 2020, at 9:49 PM, John Fastabend <john.fastabend@...il.com> wrote:
> 
> Song Liu wrote:
>> This test runs test_run for raw_tracepoint program. The test covers ctx
>> input, retval output, and proper handling of cpu_plus field.
>> 
>> Signed-off-by: Song Liu <songliubraving@...com>
>> ---
> 
> [...]
> 
>> +
>> +	test_attr.ctx_size_in = sizeof(args);
>> +	err = bpf_prog_test_run_xattr(&test_attr);
>> +	CHECK(err < 0, "test_run", "err %d\n", errno);
>> +	CHECK(test_attr.retval != expected_retval, "check_retval",
>> +	      "expect 0x%x, got 0x%x\n", expected_retval, test_attr.retval);
>> +
>> +	for (i = 0; i < nr_online; i++)
>> +		if (online[i]) {
>> +			DECLARE_LIBBPF_OPTS(bpf_prog_test_run_opts, opts,
>> +				.cpu_plus = i + 1,
>> +			);
>> +			err = bpf_prog_test_run_xattr_opts(&test_attr, &opts);
>> +			CHECK(err < 0, "test_run_with_opts", "err %d\n", errno);
>> +			CHECK(skel->data->on_cpu != i, "check_on_cpu",
>> +			      "got wrong value\n");
> 
> Should we also check retval here just to be thorough?

Good point! As we do use a different code path here. Added the check 
and removed goto in 1/3. 

I will send v2 tomorrow. 

Thanks,
Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ