diff options
author | Joel Hestness <jthestness@gmail.com> | 2015-09-29 09:25:20 -0500 |
---|---|---|
committer | Joel Hestness <jthestness@gmail.com> | 2015-09-29 09:25:20 -0500 |
commit | 395b31f518f6d5f4be3c57ae47762ad4597b0247 (patch) | |
tree | 75f1acc037fb4d928d4562e771cc5fda5939e3fe /src/base/addr_range.hh | |
parent | 9a0129dcbf3cc223c88b8c0bc46ac9b375c11abf (diff) | |
download | gem5-395b31f518f6d5f4be3c57ae47762ad4597b0247.tar.xz |
syscall_emul: Bandage readlink /proc/self/exe
The recent changeset to readlink() to handle reading the /proc/self/exe link
introduces a number of problems. This patch fixes two:
1) Because readlink() called on /proc/self/exe now uses LiveProcess::progName()
to find the binary path, it will only get the zeroth parameter of the simulated
system command line. However, if a config script also specifies the process'
executable, the executable parameter is used to create the LiveProcess rather
than the zeroth command line parameter. Thus, the zeroth command line parameter
is not necessarily the correct path to the binary executing in the simulated
system. To fix this, add a LiveProcess data member, 'executable', which is
correctly set during instantiation and returned from progName().
2) If a config script allows a user to pass a relative path as the zeroth
simulated system command line parameter or process executable, readlink() will
incorrecly return a relative path when called on '/proc/self/exe'.
/proc/self/exe is always set to a full path, so running benchmarks can fail if
a relative path is returned. To fix this, clean up the handling of
LiveProcess::progName() within readlink() to get the full binary path.
NOTE: This patch still leaves the potential problem that host full path to the
binary bleeds into the simulated system, potentially causing the appearance of
non-deterministic simulated system execution.
Diffstat (limited to 'src/base/addr_range.hh')
0 files changed, 0 insertions, 0 deletions