Bug 27008 - ld.so.cache should have endianness markup
Summary: ld.so.cache should have endianness markup
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: dynamic-link (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: 2.33
Assignee: Florian Weimer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-03 22:32 UTC by Florian Weimer
Modified: 2020-12-04 08:51 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Weimer 2020-12-03 22:32:05 UTC
With qemu-user, it's common that a process of the wrong endianness tries to parse ld.so.cache. For performance reasons, the consistency checks are somewhat limited, so crashes can be the result.
Comment 2 Florian Weimer 2020-12-04 08:46:42 UTC
Fixed for glibc 2.33 via:

commit 84ba719b260551918965d0a433914de683087645
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Dec 4 09:13:43 2020 +0100

    elf: Add endianness markup to ld.so.cache (bug 27008)
    
    Use a reserved byte in the new format cache header to indicate whether
    the file is in little endian or big endian format.  Eventually, this
    information could be used to provide a unified cache for qemu-user
    and similiar scenarios.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>