This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH COMMITTED] Do not require memset elimination in explicit_bzero test
- From: Zack Weinberg <zackw at panix dot com>
- To: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Florian Weimer <fweimer at redhat dot com>
- Date: Mon, 16 Jan 2017 10:28:25 -0500
- Subject: Re: [PATCH COMMITTED] Do not require memset elimination in explicit_bzero test
- Authentication-results: sourceware.org; auth=none
- References: <20161220100941.B4FA5401BD5F6@oldenburg.str.redhat.com> <e32dc56f-0e8b-dc05-127e-b83a932a3e4a@redhat.com> <5c0d3ac6-b4d9-21b9-19b6-ae9173102a9c@redhat.com> <d188b9b4-f134-697e-909c-526aa6a45750@linux.vnet.ibm.com> <ac2924bb-8b78-b9c2-1e97-707f731e1a5a@linux.vnet.ibm.com>
On Mon, Jan 16, 2017 at 3:24 AM, Stefan Liebler <stli@linux.vnet.ibm.com> wrote:
> On 01/10/2017 09:22 AM, Stefan Liebler wrote:
>>
>> In setup_explicit_clear, the buffer is filled with the test_pattern.
>> On s390x the memcpy in prepare_test_buffer is done by loading
>> r4 / r5 with the test_pattern and using store multiple instruction
>> to store r4 / r5 to buf.
>> If explicit_bzero is resolved in setup_explicit_clear, r4 / r5 is
>> stored to stack by _dl_runtime_resolve and the call to memmem in
>> count_test_patterns finds a hit of the test_pattern on the stack.
>>
>> The attached patch resolves all symbols at program startup by linking
>> with -z now. This omits the call of _dl_runtime_resolve within
>> setup_explicit_clear and the test passes.
>>
>> If this is okay, I'll commit this patch and clear this bug in the
>> release blockers list in the release-wiki.
This seems like a reasonable workaround to me. Please commit.
(Guess we better add "spill slots for callee-save registers, including
registers saved only by dynamic linker stubs" to the list of things to
worry about when adding explicit_bzero to the compiler...)
zw