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]
Message-ID: <87po1kqbdw.fsf@concordia.ellerman.id.au>
Date:   Fri, 25 May 2018 20:26:35 +1000
From:   Michael Ellerman <mpe@...erman.id.au>
To:     Thiago Jung Bauermann <bauerman@...ux.ibm.com>
Cc:     linuxppc-dev@...ts.ozlabs.org, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org, Ram Pai <linuxram@...ibm.com>,
        Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com>
Subject: Re: [PATCH 1/2] selftests/powerpc: Add ptrace tests for Protection Key registers

Thiago Jung Bauermann <bauerman@...ux.ibm.com> writes:
> Michael Ellerman <mpe@...erman.id.au> writes:
>> Thiago Jung Bauermann <bauerman@...ux.vnet.ibm.com> writes:
>>>  tools/testing/selftests/powerpc/include/reg.h      |   1 +
>>>  tools/testing/selftests/powerpc/ptrace/Makefile    |   5 +-
>>>  tools/testing/selftests/powerpc/ptrace/child.h     | 130 ++++++++
>>>  .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 326 +++++++++++++++++++++
>>
>> This is failing on machines without pkeys:
>>
>>   test: ptrace_pkey
>>   tags: git_version:52e7d87
>>   [FAIL] Test FAILED on line 117
>>   [FAIL] Test FAILED on line 191
>>   failure: ptrace_pkey
>>
>>
>> I think the first fail is in the child here:
>>
>> int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[],
>> 		     int n)
>> {
>> 	struct iovec iov;
>> 	long ret;
>>
>> 	FAIL_IF(start_trace(child));
>>
>> 	iov.iov_base = regs;
>> 	iov.iov_len = n * sizeof(unsigned long);
>>
>> 	ret = ptrace(PTRACE_GETREGSET, child, type, &iov);
>> 	FAIL_IF(ret != 0);
>>
>>
>> Which makes sense.
>
> Yes, that is indeed what is going on.
>
>> The test needs to skip if pkeys are not available/enabled. Using the
>> availability of the REGSET might actually be a nice way to detect that,
>> because it's read-only.
>
>  I forgot to consider the case of pkeys not available or not enabled,
>  sorry about that.

No worries.

> I just sent a v2 which implements your suggestion above.

Thanks.

cheers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ