Bug 381805 - arm32 needs ld.so index hardwire for new glibc security fixes
Summary: arm32 needs ld.so index hardwire for new glibc security fixes
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.13.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-29 18:00 UTC by Mark Wielaard
Modified: 2017-07-05 09:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ARM hardwire for ld.so index function (2.06 KB, patch)
2017-06-29 18:00 UTC, Mark Wielaard
Details

Note You need to log in before you can comment on or make changes to this bug.
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.