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] [thread-next>] [day] [month] [year] [list]
Message-ID: <f052afb8-abca-4279-8186-05df35044bdd@collabora.com>
Date: Thu, 11 Jul 2024 11:13:54 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Catalin Marinas <catalin.marinas@....com>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
 Will Deacon <will@...nel.org>, Shuah Khan <shuah@...nel.org>,
 Kunwu Chan <chentao@...inos.cn>, kernel@...labora.com,
 linux-arm-kernel@...ts.infradead.org, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 1/2] selftests: arm64: tags_test: conform test to TAP
 output

On 7/10/24 4:31 PM, Catalin Marinas wrote:
> On Sun, Jun 02, 2024 at 06:24:59PM +0500, Muhammad Usama Anjum wrote:
>> Conform the layout, informational and status messages to TAP. No
>> functional change is intended other than the layout of output messages.
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
>> ---
>>  tools/testing/selftests/arm64/tags/tags_test.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/tools/testing/selftests/arm64/tags/tags_test.c b/tools/testing/selftests/arm64/tags/tags_test.c
>> index 955f87c1170d7..8ae26e496c89c 100644
>> --- a/tools/testing/selftests/arm64/tags/tags_test.c
>> +++ b/tools/testing/selftests/arm64/tags/tags_test.c
>> @@ -17,19 +17,21 @@ int main(void)
>>  	static int tbi_enabled = 0;
>>  	unsigned long tag = 0;
>>  	struct utsname *ptr;
>> -	int err;
>> +
>> +	ksft_print_header();
>> +	ksft_set_plan(1);
>>  
>>  	if (prctl(PR_SET_TAGGED_ADDR_CTRL, PR_TAGGED_ADDR_ENABLE, 0, 0, 0) == 0)
>>  		tbi_enabled = 1;
>>  	ptr = (struct utsname *)malloc(sizeof(*ptr));
>>  	if (!ptr)
>> -		ksft_exit_fail_msg("Failed to allocate utsname buffer\n");
>> +		ksft_exit_fail_perror("Failed to allocate utsname buffer");
>>  
>>  	if (tbi_enabled)
>>  		tag = 0x42;
>>  	ptr = (struct utsname *)SET_TAG(ptr, tag);
>> -	err = uname(ptr);
>> +	ksft_test_result(!uname(ptr), "Syscall successful with tagged address\n");
>>  	free(ptr);
>>  
>> -	return err;
>> +	ksft_finished();
>>  }
> 
> Sorry, these patches slipped through the cracks. We seem to be pretty
> inconsistent with using ksft_exit_fail_perror() and ksft_finished(). Is
> there some plan to update the rest or is it only this location that you
> came across?
Ideally we would want that all the test are updated to output better logs
than what they have currently. We may update some more tests. This is
something we want the maintainers to get aware of that kselftest.h wrapper
provide helper function to better write the tests and then all contributors
start using it in new tests and older tests may also get updated in the
process.

> 
> Adding Mark Brown as well to this thread, he's been contributing quite a
> lot recently to the arm64 kselftests.
> 

-- 
BR,
Muhammad Usama Anjum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ