mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Always add AT_BASE even if there is no interpreter.
Linux will ALWAYS add AT_BASE even for a static binary, expect it will be set to 0 [1]. 1. https://github.com/torvalds/linux/blob/master/fs/binfmt_elf.c#L253 PiperOrigin-RevId: 209811129 Change-Id: I92cc66532f23d40f24414a921c030bd3481e12a0
This commit is contained in:
@@ -655,6 +655,9 @@ func loadELF(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace
|
||||
// Start in the interpreter.
|
||||
// N.B. AT_ENTRY above contains the *original* entry point.
|
||||
bin.entry = interp.entry
|
||||
} else {
|
||||
// Always add AT_BASE even if there is no interpreter.
|
||||
bin.auxv = append(bin.auxv, arch.AuxEntry{linux.AT_BASE, 0})
|
||||
}
|
||||
|
||||
return bin, ac, nil
|
||||
|
||||
Reference in New Issue
Block a user