On 5/19/26 22:55, Michael Tokarev wrote:
On 01.05.2026 14:18, Helge Deller wrote:
From: Helge Deller <[email protected]>
The AT_EXECFN entry in AUXV needs to keep the value which was used when
the program was started. Especially for symlinked programs qemu should
not try to resolve the realpath.
Here is a reproducer:
(arm64-chroot)root@p100:/# cd /usr/bin
(arm64-chroot)root@p100:/usr/bin# ln -s echo testprog
(arm64-chroot)root@p100:/usr/bin# LD_SHOW_AUXV=1 ./testprog | grep AT_EXECFN
AT_EXECFN: ./testprog
In this example, "./testprog" is the correct output, and not "/usr/bin/echo".
This patch fixes parts of commit 258bec39 ("linux-user: Fix access to
/proc/self/exe").
Fixes: 258bec39 ("linux-user: Fix access to /proc/self/exe")
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3379
Signed-off-by: Helge Deller <[email protected]>
--- a/linux-user/user-internals.h
+++ b/linux-user/user-internals.h
@@ -24,6 +24,7 @@
#include "exec/translation-block.h"
extern char *exec_path;
+extern char real_exec_path[PATH_MAX];
btw, why this is not char*, allocated dynamically?
no specific reason.
I'm picking this up for qemu-stable. Please let me know if I shouldn't.
Please pick up.
Thanks!
Helge