summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/loader/elf.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-10-08 11:38:02 -0700
committerShentubot <shentubot@google.com>2018-10-08 11:39:54 -0700
commit569c2b06c47d269d961405fa652d45e51860d005 (patch)
treeaabbf7fc7e786d0699d9ea1d34f7048fb4339761 /pkg/sentry/loader/elf.go
parente9e8be661328661b5527f1643727b9a13bbeab48 (diff)
Statfs Namelen should be NAME_MAX not PATH_MAX
We accidentally set the wrong maximum. I've also added PATH_MAX and NAME_MAX to the linux abi package. PiperOrigin-RevId: 216221311 Change-Id: I44805fcf21508831809692184a0eba4cee469633
Diffstat (limited to 'pkg/sentry/loader/elf.go')
-rw-r--r--pkg/sentry/loader/elf.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/sentry/loader/elf.go b/pkg/sentry/loader/elf.go
index f4deaa905..849be5a3d 100644
--- a/pkg/sentry/loader/elf.go
+++ b/pkg/sentry/loader/elf.go
@@ -19,7 +19,6 @@ import (
"debug/elf"
"fmt"
"io"
- "syscall"
"gvisor.googlesource.com/gvisor/pkg/abi"
"gvisor.googlesource.com/gvisor/pkg/abi/linux"
@@ -409,7 +408,7 @@ func loadParsedELF(ctx context.Context, m *mm.MemoryManager, f *fs.File, info el
ctx.Infof("PT_INTERP path too small: %v", phdr.Filesz)
return loadedELF{}, syserror.ENOEXEC
}
- if phdr.Filesz > syscall.PathMax {
+ if phdr.Filesz > linux.PATH_MAX {
ctx.Infof("PT_INTERP path too big: %v", phdr.Filesz)
return loadedELF{}, syserror.ENOEXEC
}