Bug 381805

Summary: arm32 needs ld.so index hardwire for new glibc security fixes
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal CC: fweimer
Priority: NOR    
Version: 3.13.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: ARM hardwire for ld.so index function

Description Mark Wielaard 2017-06-29 18:00:54 UTC
Created attachment 106374 [details]
ARM hardwire for ld.so index function

Originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=1466017

glibc added some security hardening adding (optimized) index/strchr calls in the LD_PRELOAD path:

commit 6d0ba622891bed9d8394eef1935add53003b12e8
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Jun 19 22:31:04 2017 +0200

    ld.so: Reject overly long LD_PRELOAD path elements

arm32 doesn't have an ld.so hardwire for index/strchr like other architectures and so will always complain during early startup:

==9495== Conditional jump or move depends on uninitialised value(s)
==9495==    at 0x401CF84: index (in /usr/lib/ld-2.25.so)
==9495== 
==9495== Conditional jump or move depends on uninitialised value(s)
==9495==    at 0x401CF88: index (in /usr/lib/ld-2.25.so)

index/strchr is doing a word load from a partially-written stack-allocated buffer, therefore accessing uninitialized data.  This is normal for an optimized string function.  The uninitialized data does not affect the function result.

This can be suppressed by adding a index hardwire for ld.so on arm32 like on other arches. There even is already some commented out code to do that.
Comment 1 Mark Wielaard 2017-07-05 09:58:51 UTC
valgrind svn r16458.