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]
Date:   Tue, 27 Jun 2017 10:36:56 -0600
From:   Shuah Khan <shuahkh@....samsung.com>
To:     Greg KH <gregkh@...uxfoundation.org>
Cc:     paul.elder@...t.edu, panand@...hat.com, will.deacon@....com,
        labath@...gle.com, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org, Shuah Khan <shuahkh@....samsung.com>,
        Shuah Khan <shuah@...nel.org>
Subject: Re: [PATCH] selftests: breakpoints: convert breakpoint_test_arm64
 test to TAP13

On 06/27/2017 10:11 AM, Greg KH wrote:
> On Tue, Jun 27, 2017 at 10:04:47AM -0600, Shuah Khan wrote:
>> Convert breakpoint_test_arm64 output to TAP13 format.
>>
>> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
>> ---
>>  .../selftests/breakpoints/breakpoint_test_arm64.c  | 114 ++++++++++++++-------
>>  1 file changed, 79 insertions(+), 35 deletions(-)
>>
>> diff --git a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
>> index fa6d57af5217..d13bd0dea13e 100644
>> --- a/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
>> +++ b/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c
>> @@ -41,20 +41,27 @@ static volatile uint8_t var[96] __attribute__((__aligned__(32)));
>>  static void child(int size, int wr)
>>  {
>>  	volatile uint8_t *addr = &var[32 + wr];
>> +	char msg_buf[512];
>>  
>>  	if (ptrace(PTRACE_TRACEME, 0, NULL, NULL) != 0) {
>> -		perror("ptrace(PTRACE_TRACEME) failed");
>> -		_exit(1);
>> +		snprintf(msg_buf, sizeof(msg_buf),
>> +			 "ptrace(PTRACE_TRACEME) failed: %s\n",
>> +			 strerror(errno));
>> +		ksft_exit_fail_msg(msg_buf);
> 
> No objection to this patch, but perhaps the "msg" functions could either
> be variable arg macros, or just a printk() like function that can take
> the string and anything you want to send to it.

Right. Changing "msg" functions to take var args will make things easier.
I will take care of that and use this test for a use-case.

> 
> So this could be:
> 		ksft_exit_fail_msg("ptrace(PTRACE_TRACEME) failed: %s\n", strerror(errno));

Right.

> 
> Anyway, just a thought, might make conversions a lot easier, no need for
> intermediate buffers> 
> thanks,
> 
> greg k-h
> 

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ