This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH COMMITTED] Do not require memset elimination in explicit_bzero test


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]