From 545ea7ab3fa3e976120b74da3271dc7724c05f5e Mon Sep 17 00:00:00 2001 From: Brian Geffon Date: Wed, 22 Aug 2018 12:35:40 -0700 Subject: 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 --- pkg/sentry/loader/elf.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/sentry/loader') diff --git a/pkg/sentry/loader/elf.go b/pkg/sentry/loader/elf.go index 0462a1788..f4deaa905 100644 --- a/pkg/sentry/loader/elf.go +++ b/pkg/sentry/loader/elf.go @@ -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 -- cgit v1.2.3