From 365fba2440cee3aed74c774867a1f43e3e2f7aac Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 18 Apr 2020 14:43:29 +0200 Subject: executor: surround the data mapping with PROT_NONE pages Surround the main data mapping with PROT_NONE pages to make virtual address layout more consistent across different configurations (static/non-static build) and C repros. One observed case before: executor had a mapping above the data mapping (output region), while C repros did not have that mapping above, as the result in one case VMA had next link, while in the other it didn't and it caused a bug to not reproduce with the C repro. The bug that reproduces only with the mapping above: https://lkml.org/lkml/2020/4/17/819 --- sys/linux/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/linux') diff --git a/sys/linux/init.go b/sys/linux/init.go index 6a10c7d82..c9c15a283 100644 --- a/sys/linux/init.go +++ b/sys/linux/init.go @@ -48,7 +48,7 @@ func InitTarget(target *prog.Target) { ARCH_SET_GS: target.ConstMap["ARCH_SET_GS"], } - target.MakeDataMmap = targets.MakePosixMmap(target, true) + target.MakeDataMmap = targets.MakePosixMmap(target, true, true) target.Neutralize = arch.neutralize target.SpecialTypes = map[string]func(g *prog.Gen, typ prog.Type, old prog.Arg) ( prog.Arg, []*prog.Call){ -- cgit mrf-deployment