Commit 1aaf3b45 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Make sure that elf_image structure is copied.

A previous change modified the code so that a pointer to the elf_image
structure from the map data was returned instead of copied. This can
cause a race condition when doing local unwinds if the map needs to be
rebuilt. One thread might have a pointer to a freed data structure.

To fix this, make sure that the elf_image is always copied when the
contents are going to be used.

In addition, remove the map pointer in the mapped data because it could
also be stale when a local unwind causes a map rebuild. Add a big comment
in front of the elf_image structure to explain this so it won't happen
again.

Bug: 27123610

(cherry picked from commit 2c0f916c)

Change-Id: I162b396c24923fe9e3d774488b221244d822096c
parent 93507223
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment