aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/init.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-08-09 12:40:58 +0200
committerDmitry Vyukov <dvyukov@google.com>2022-08-10 11:45:49 +0200
commit8fad22bf840fc968171bee6cf294f026eb1e0d3a (patch)
tree2bad644606904f4e75ef6fe689bac49e91877c40 /sys/linux/init.go
parenta12254451cfa5e5129a0c091255d502b6805adf6 (diff)
prog: generate very long file names
Generate very long file names once in a while to provoke bugs like: https://github.com/google/gvisor/commit/f857f268eceb1cdee0b2bdfa218c969c84033fcd
Diffstat (limited to 'sys/linux/init.go')
-rw-r--r--sys/linux/init.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/linux/init.go b/sys/linux/init.go
index 6c486c2ed..480ac1d96 100644
--- a/sys/linux/init.go
+++ b/sys/linux/init.go
@@ -98,6 +98,18 @@ func InitTarget(target *prog.Target) {
panic("unknown arch")
}
+ target.SpecialFileLenghts = []int{
+ int(target.GetConst("PATH_MAX")),
+ int(target.GetConst("UNIX_PATH_MAX")),
+ int(target.GetConst("NAME_MAX")),
+ int(target.GetConst("BTRFS_INO_LOOKUP_PATH_MAX")),
+ int(target.GetConst("BTRFS_INO_LOOKUP_USER_PATH_MAX")),
+ int(target.GetConst("SMB_PATH_MAX")),
+ int(target.GetConst("XT_CGROUP_PATH_MAX")),
+ int(target.GetConst("XENSTORE_REL_PATH_MAX")),
+ 1 << 16, // gVisor's MaxFilenameLen
+ }
+
if target.Arch == runtime.GOARCH {
KCOV_INIT_TRACE = uintptr(target.GetConst("KCOV_INIT_TRACE"))
KCOV_ENABLE = uintptr(target.GetConst("KCOV_ENABLE"))