diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-07-16 17:01:29 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-07-16 17:02:02 +0200 |
| commit | df5ae5f537c164da6feb31c645aa607d0c017ba5 (patch) | |
| tree | 1769999af4b3a51a286da3c4ac15cc767f7e536f /sys | |
| parent | 474681b37b04f88b127fcece0c2129f4130db379 (diff) | |
sys/akaros: don't call provision(-1)
It causes kernel debug splat,
which has high chances of corrupting kernel crashes.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/akaros/init.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/akaros/init.go b/sys/akaros/init.go index 58d0d1f5f..c3b9e521a 100644 --- a/sys/akaros/init.go +++ b/sys/akaros/init.go @@ -13,6 +13,25 @@ func init() { prog.RegisterTarget(gen.Target_amd64, initTarget) } +type arch struct { + unix *targets.UnixSanitizer +} + func initTarget(target *prog.Target) { + arch := &arch{ + unix: targets.MakeUnixSanitizer(target), + } target.MakeMmap = targets.MakePosixMmap(target) + target.SanitizeCall = arch.sanitizeCall +} + +func (arch *arch) sanitizeCall(c *prog.Call) { + arch.unix.SanitizeCall(c) + switch c.Meta.CallName { + case "provision": + if pid, ok := c.Args[0].(*prog.ConstArg); ok && uint32(pid.Val) == ^uint32(0) { + // pid -1 causes some debugging splat on console. + pid.Val = 0 + } + } } |
